Python Forum

Full Version: Configuring interpretor in PyCharm: [Errno 2] No such file or directory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I created a new virtual environment for my project in python3.6.4 so can start using that instead of the previous version python3.5. However, today I opened my PyCharm IDE and found that it doesn't recognize tkinter anymore:
Error:
File "/usr/lib/python3.5/tkinter/__init__.py", line 38, in <module> raise ImportError(str(msg) + ', please install the python3-tk package') ImportError: No module named '_tkinter', please install the python3-tk package
I realized that the reason for this is most likely because the python interpreter isn't located at the right source, so I went to take a look in settings and saw that the interpreter is from the virtualenv environment and was of course from /usr/lib/python3.5, which it took from a source that is excluded by PyCharm and isn't even part of the virtual environment. To fix this I tried to configure it to use the Conda environment, which uses python3.6.4 and was the option below Virtualenv Environment. After choosing its executable from /virtualenv/bin and pressed ok, it gave me a "failed to create interpreter" dialogue with the following error:
Error:
/home/user/Python-Projekte/python3-projekte/virtualenv/bin/python3.6: can't open file 'create': [Errno 2] No such file or directory
Then I thought it might be the location that's not configured properly so I went on to fix that (it used to be /home/user/.conda/envs/Python-Projekte), however,my configuration wasn't recognized. Does anyone know why this happens and how to fix this?