Changing Python console's Python interpreter based on the "focused" file's parent project's Python interpreter.

Answered

Background: Using PyCharm 2018.1 (Professional Edition) - Build #PY-181.4203.547. I am working on MacOS 10.13.3. 

I am working with many projects open in a single window:

Each project has its own virtualenv registered (via "Preferences" -> "Project" -> "Project Interpreter", etc.).

My question is this: if I am "focused" on a Python file, which is a file within Project X, which has its own interpreter, is there a way to open a Python Console (sub)window using the associated Python interpreter?

Currently, if I click "Tools" -> "Python Console...", a Python Console (sub)window will open. The interpreter that is used is the interpreter that is last selected here: 

Judging by the organization of the above settings ("Environment" -> "Project" and "Python interpreter"), it seems like PyCharm would behave in a way that chooses the Console's interpreter based on the focused file's project, but apparently that's not so. 

Any ideas? 

6
3 comments
Official comment

Hi,

Python Console has its own settings, including python interpreter. So it doesn't change its interpreter according to the project you are switching to. If you would like to have such feature, please feel free to submit a feature request about it to our issue tracker using the link https://youtrack.jetbrains.com/issues/PY.

Avatar
Permanently deleted user

I am having the same problem.

Any solution ?

0
Avatar
Permanently deleted user

same problem

----------

EDIT: I've posted an feature request here, further discussion may goes there https://youtrack.jetbrains.com/issue/PY-33268

0

Please sign in to leave a comment.