Cépagrave
Cépagrave

Reputation: 188

pycharm doesn't see python3.7 interpreter

I'm using Pycharm Community 2018.1.4 on Linux Mint 19 Tara Xfce.

It works well with Python 3.5 interpreter. I installed Python 3.7 to be the default Python interpreter on the system.

python -V command returns Python 3.7.0b3 I would like to use Python 3.7 in Pycharm.

I've tried :

which python

/usr/bin/python

which python3.7

/usr/local/bin/python3.7

When I go to File > Settings > Project and Interpreter > Add and there is no /usr/local folder and there is no python3.7 in /usr/bin

I can cd to /usr/local/bin folder in the terminal, but Pycharm just can't. I restarted, uninstalled/reinstalled Pycharm, refreshed its inner browser, restarted my pc. Nothing changed.

What am I missing?

Upvotes: 12

Views: 25549

Answers (6)

Anand Mishra
Anand Mishra

Reputation: 1

use ctrl + alt + s to open interpreter the select the one you wanted to use that is for the environment you have chosen. If you wanted to change the interpreter for the environment the go to the interpreter settings after pressing the ctrl + alt + s and select the environment interpreter.

Upvotes: 0

strannik-j
strannik-j

Reputation: 99

In flatpak-version PyCharm you can found host-os files in this directory:

/var/run/host/

For example:

/var/run/host/usr/bin/python3.8

But this is a bad way. It is better to install from the ppa.

Upvotes: 0

11dur
11dur

Reputation: 61

I had the same issues with Pycharm Community Edition 2020.1, Linux Mint 19.3.

For reasons I don't know, the Flatpak version, which is only provided in Linux Mint's repositories can't see and access most of the directories which are beyond the user's home.

Pycharm 2020.1 Flatpak comes with a Python 3.7 interpreter, which seems to live in the virtual environment, located in the user's home. I tried to change for the default python3 compiler of Linux Mint 19.3, which is version 3.6 and lives in /usr/bin - no chance, neither by navigating with Pycharm's file browser, nor by copy and paste to the path field.

Strangely also most of the directories e.g. below /usr/lib weren't displayed.

I then installed Pycharm via a ppa (alternative package repository for some Linux flavors), to be specific this one

Voilà! Any installed interpreter is accessible and can be selected.

Upvotes: 6

GIxxxer
GIxxxer

Reputation: 11

if you already have 3.7 installed. right click and run Pycharm as admin. then it should display, and install the new packages.

Upvotes: 1

Sraw
Sraw

Reputation: 20196

How do you launch Python3.7 in terminal? For example, you use python3.7 to launch.

Then you can which python3.7 to find where it is.

And then add that path to your Pycharm's Python Interpreter.

Upvotes: 1

AKX
AKX

Reputation: 168824

You will need to add the interpreter to the list of available interpreters.

Use which python to find out the path of the interpreter, then in the Settings > Project Interpreter > Add > System Interpreter window hit the "..." button and add that interpreter. (The screenshot below is from macOS, but it should be the same on Linux.)

enter image description here

Upvotes: 12

Related Questions