Title: Getting "No module named '_tkinter'" error · Issue #9017 · matplotlib/matplotlib · GitHub
Open Graph Title: Getting "No module named '_tkinter'" error · Issue #9017 · matplotlib/matplotlib
X Title: Getting "No module named '_tkinter'" error · Issue #9017 · matplotlib/matplotlib
Description: Bug report I just wanted to use matplotlib to draw a line graph and save it to a file, but every time I try to import the pyplot module I get the abovementioned error message. python3 -c "import matplotlib.pyplot" Actual outcome >>> impo...
Open Graph Description: Bug report I just wanted to use matplotlib to draw a line graph and save it to a file, but every time I try to import the pyplot module I get the abovementioned error message. python3 -c "import ma...
X Description: Bug report I just wanted to use matplotlib to draw a line graph and save it to a file, but every time I try to import the pyplot module I get the abovementioned error message. python3 -c "impo...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9017
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Getting \"No module named '_tkinter'\" error","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\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\r\n\r\nI just wanted to use matplotlib to draw a line graph and save it to a file, but every time I try to import the pyplot module I get the abovementioned error message.\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\n```\r\npython3 -c \"import matplotlib.pyplot\"\r\n```\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\n\u003e\u003e\u003e import matplotlib.pyplot\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/usr/local/lib/python3.6/site-packages/matplotlib/pyplot.py\", line 115, in \u003cmodule\u003e\r\n _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()\r\n File \"/usr/local/lib/python3.6/site-packages/matplotlib/backends/__init__.py\", line 32, in pylab_setup\r\n globals(),locals(),[backend_name],0)\r\n File \"/usr/local/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py\", line 6, in \u003cmodule\u003e\r\n from six.moves import tkinter as Tk\r\n File \"/usr/local/lib/python3.6/site-packages/six.py\", line 92, in __get__\r\n result = self._resolve()\r\n File \"/usr/local/lib/python3.6/site-packages/six.py\", line 115, in _resolve\r\n return _import_module(self.mod)\r\n File \"/usr/local/lib/python3.6/site-packages/six.py\", line 82, in _import_module\r\n __import__(name)\r\n File \"/usr/local/lib/python3.6/tkinter/__init__.py\", line 36, in \u003cmodule\u003e\r\n import _tkinter # If this fails your Python may not be configured for Tk\r\nModuleNotFoundError: No module named '_tkinter'\r\n```\r\n\r\n**Expected outcome**\r\n\r\nWhatever happens when `import matplotlib.pyplot` succeeds\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: Windows Subsystem for Linux\r\n * Matplotlib Version: 2.0.2\r\n * Python Version: 3.6.0\r\n\r\nI installed matplotlib using pip.\r\nDoing `sudo apt-get install python3-tk`, as recommended by someone on Stack Overflow, didn't help.","author":{"url":"https://github.com/SamusAranX","@type":"Person","name":"SamusAranX"},"datePublished":"2017-08-10T21:11:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":23},"url":"https://github.com/9017/matplotlib/issues/9017"}
| 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:e554acab-80a8-e765-05be-06f991e3d2e8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80B0:305538:4552350:602D0F4:6A54DFC3 |
| html-safe-nonce | c7c3bf93a646ab23679b12c0ef62a7a79d5931544959ae5ea78ead066c91a793 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEIwOjMwNTUzODo0NTUyMzUwOjYwMkQwRjQ6NkE1NERGQzMiLCJ2aXNpdG9yX2lkIjoiMzU1MTIwNDI4OTI2MjQ0NDQ4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3d3e16eba9113acfebbb971efe781aab630c0b64d424159a3dd60a8777e99027 |
| hovercard-subject-tag | issue:249478054 |
| 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/9017/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86ce18dadd7f529857f94f65bdc05347ef417365ec48f81b59742cfaae2aec80/matplotlib/matplotlib/issues/9017 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86ce18dadd7f529857f94f65bdc05347ef417365ec48f81b59742cfaae2aec80/matplotlib/matplotlib/issues/9017 |
| og:image:alt | Bug report I just wanted to use matplotlib to draw a line graph and save it to a file, but every time I try to import the pyplot module I get the abovementioned error message. python3 -c "import ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SamusAranX |
| hostname | github.com |
| expected-hostname | github.com |
| None | a556215b071af6609619e2bbe6f00bdfbf0812ad723b1ae6c301858a7a829f54 |
| 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 | 00f21e38abd06cd6752db5c227083570f72fdb6c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width