Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set default PyCharm interpreter?

My PyCharm installation has two interpreters available:

  • Python 3.3.2 (/usr/bin/python3.3m)
  • Python 2.7.5 (/usr/bin/python2.7)

Whenever I open a new project it sets the interpreter to Python 3. Since I work mostly with 2.7, this means in most cases I have to reconfigure it. How do I change it to use 2.7 by default for new projects?

Update: After setting the default interpreter to Python 2.7.5 in File → Default Settings → Project Interpreter and removing the .idea/misc.xml file, the interpreter is now not set at all in misc.xml. Better than setting it to Python 3.3, but still...

like image 322
l0b0 Avatar asked Oct 30 '13 10:10

l0b0


People also ask

What is base interpreter in PyCharm?

Configure a system interpreter To work with your Python code in PyCharm, you need to configure at least one interpreter. A system interpreter is the one that comes with your Python installation. You can use it solely for all Python scripts or take it as a base interpreter for Python virtual environments.

What is the default Python interpreter?

By default, the Python extension looks for and uses the first Python interpreter it finds in the system path. To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).

Where does PyCharm store interpreter settings?

IDE settings are stored in the dedicated directories under PyCharm home directory. The PyCharm directory name is composed of the product name and version.


1 Answers

File | Default Settings | Project Interpreter.

This configuration sets the default interpreter for the new projects, note the Default Settings menu, it's not the same as File | Settings which sets options for the current project.

If there is no open project, you can access this menu from the Welcome Screen (Configure | Settings).

Please note that it affects Open Directory option. Once you open a directory with your files, a new project will be created with the default interpreter that you have configured using the above steps. New Project option will show you the list of configured interpreters in default order and you will have to choose which one to use. There is a related request to suggest the most frequently used interpreter first.

like image 194
CrazyCoder Avatar answered Sep 22 '22 13:09

CrazyCoder