Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing python interpreter windows

Tags:

python

windows

I have two python installations, 2.5 and 2.6 I want to change the default python interpreter from 2.5 to 2.6. Anyone know how?

like image 417
Diones Avatar asked Jun 27 '09 22:06

Diones


People also ask

How do I change Python interpreter in Windows?

Click on start > control panel > system > advanced > environment variables. Select "path". Edit it. Click on OK enough times to get out of there.

How do I change Python interpreter?

Change the Python interpreter in the project settingsPress Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter. Expand the list of the available interpreters and click the Show All link. Select the target interpreter.

Where is Python interpreter path in Windows?

First, press Start in the lower-left corner then press Search followed by all files and folders. Type python.exe in the top text line that shows up and then press the search. A folder name will be listed where Python got installed. Hence the folder name becomes the path of Python.

How do I change the interpreter in Python Vscode?

To do so, open the Command Palette (Ctrl+Shift+P) and enter Preferences: Open User Settings. Then set python.defaultInterpreterPath , which is in the Python extension section of User Settings, with the appropriate interpreter.


2 Answers

PYTHONPATH is NOT what you are looking for. That is for varying where Python's "import" looks for packages and modules.

You need to change the PATH variable in your environment so that it contains e.g. "....;c:\python26;...." instead of "....;c:\python25;....". Click on start > control panel > system > advanced > environment variables. Select "path". Edit it. Click on OK enough times to get out of there.

like image 183
John Machin Avatar answered Sep 28 '22 23:09

John Machin


just FYI, since both c:\python25 and c:\python26 are on PATH, I copy C:\Python25\python.exe to C:\Python25\py25.exe, and copy C:\Python26\python.exe to C:\Python26\py26.exe Then just type py25(or py26) get the specific version.

like image 40
sunqiang Avatar answered Sep 28 '22 22:09

sunqiang