PyCharm is showing python 3.7, but python 3.5 is installed on my system

Answered

I'm running PyCharm 2018.2 on LMDE 9.3 and it's showing a different installation of Python than what's installed on the system.  Here's a screenshot showing this:  https://pasteboard.co/HGiNoQu.png

Not only to I need to test against python 3.5 since that's what's currently shipped with many server distros, but also this is causing issues with my virtual environment created using the venv module which symlinks the back to the root install.  In the shell I can see the virtual environment as 3.5 and all the modules are there, however in a shell in PyCharm it's 3.7 with no pip and the modules are broken.

10 comments
Comment actions Permalink

Yes I've checked tried that, but the only local interpreters that PyCharm sees is Python 2.7 and 3.7, when the only ones I have installed on my computer are 2.7 and 3.5.

0
Comment actions Permalink

Thank you for the update.

Please clarify if you have browsed when creating interpreter in PyCharm to the python.exe where you have installed python 3.5? (https://www.reddit.com/r/learnprogramming/comments/3mr57z/pycharm_doesnt_detect_interpreter/)

Please provide a screenshot demonstrating the problem.

0
Comment actions Permalink

As you can see in the following screenshot, PyCharm doesn't see the python3.5 interpreter on my computer:

https://pasteboard.co/HGqPYgJ.png

It's as if PyCharm is working in a chroot or an overlay filesystem.  On the top right of that screenshot you can see python executables in /usr/bin, on the bottom right I hace my virtual environment created with python's built in venv module and on the left I have PyCharm mysteriously finding python that shouldn't exist and not finding python that does exist on my computer.

0
Comment actions Permalink

Could you please try refresh button?

0
Comment actions Permalink

I found the issue.  Linux mint's software manager installs apps using flatpak: https://pasteboard.co/HGr2BDI.png

I've removed the installation and reinstalled using the JetBrains toolbox (since PyCharm isn't in Debian's repos).  The new install is seeing the correct version of python now.

0
Comment actions Permalink

Thank you very much for letting me know.

Glad that it works now.

0
Comment actions Permalink

Thank you for this report. We had exactly the same problem today and it was a real mystery. It didn't only happen with pycharm but also with visual studio code. Finding this post was a life-saver. Thank you!

0
Comment actions Permalink

I eventually figured out my issue was caused by how I installed pycharm.  I had used the app store which installs a flatpack.  Due to how flatpacks work, it installs an isolated environment containing everything the app needs.  With normal apps this could be useful at the expense of duplicate files using extra disk space, but for development apps it makes it so you can't run your code reliably from inside the flatpack installed app.

0
Comment actions Permalink

In case you have any issues, we recommend reinstalling PyCharm from one of the officially maintained sources:

- JetBrains website: www.jetbrains.com

- JetBrains Toolbox App: https://www.jetbrains.com/toolbox/app/

- Ubuntu Snap package manager

0

Please sign in to leave a comment.