Title: Confusing error message when home config directory not writable · Issue #18011 · matplotlib/matplotlib · GitHub
Open Graph Title: Confusing error message when home config directory not writable · Issue #18011 · matplotlib/matplotlib
X Title: Confusing error message when home config directory not writable · Issue #18011 · matplotlib/matplotlib
Description: Bug report Bug summary If matplotlib is run in an environment without a writable home directory, a very confusing error message is printed in which the configdir and the tempdir are interchanged. Code for reproduction In Linux, create a ...
Open Graph Description: Bug report Bug summary If matplotlib is run in an environment without a writable home directory, a very confusing error message is printed in which the configdir and the tempdir are interchanged. C...
X Description: Bug report Bug summary If matplotlib is run in an environment without a writable home directory, a very confusing error message is printed in which the configdir and the tempdir are interchanged. C...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18011
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Confusing error message when home config directory not writable","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nIf matplotlib is run in an environment without a writable home directory, a very confusing error message is printed in which the configdir and the tempdir are interchanged. \r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n1. In Linux, create a user `someone` with no home directory. \r\n2. Run Python with a command like\r\n\r\n sudo -u someone python3\r\n\r\n3. In the Python shell, type `import matplotlib`\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n```\r\nMatplotlib created a temporary config/cache directory at /root/.config/matplotlib because the default path (/tmp/matplotlib-9yoi7m8l) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.\r\n```\r\n\r\n**Expected outcome**\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\r\n```\r\nMatplotlib created a temporary config/cache directory at /tmp/matplotlib-9yoi7m8l because the default path (/root/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.\r\n```\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Ubuntu 18.04\r\n * Matplotlib version: 3.3.0\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): agg\r\n * Python version: 3.9.0b4\r\n * Jupyter version (if applicable): N/A\r\n * Other libraries: N/A\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\nMatplotlib was compiled from source. The error is at line 482 in `__init__.py` at the root level in the source tree. The parameters are the wrong way round.","author":{"url":"https://github.com/trampgeek","@type":"Person","name":"trampgeek"},"datePublished":"2020-07-22T03:41:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/18011/matplotlib/issues/18011"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40a94989-8382-252a-1b10-ec096e686324 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DE9A:1FACCA:40C61:577CE:6A52D842 |
| html-safe-nonce | 649a512ce8a4faafede805f47176440df72b17b1a2bfaabd14392a2997e16f88 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTlBOjFGQUNDQTo0MEM2MTo1NzdDRTo2QTUyRDg0MiIsInZpc2l0b3JfaWQiOiI4MzQxODA4NzIzODY2NjA1NjM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9493a97e2bf1b0da564c8f8f51c709a91f5c0ee9e76d5f48a519d92f4fd971e5 |
| hovercard-subject-tag | issue:663449729 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/18011/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bed49b1eb2e9ad2f6e9ec1257b49faf4c2514c5761e38edd218c52f663ab983a/matplotlib/matplotlib/issues/18011 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bed49b1eb2e9ad2f6e9ec1257b49faf4c2514c5761e38edd218c52f663ab983a/matplotlib/matplotlib/issues/18011 |
| og:image:alt | Bug report Bug summary If matplotlib is run in an environment without a writable home directory, a very confusing error message is printed in which the configdir and the tempdir are interchanged. C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trampgeek |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width