I need help to switch between python 2.7 and 3.4 in windows 10 command prompt. I have installed both version but by default python 2.7 is selected. Need some command in cmd which help to switch between versions.
Asked
Active
Viewed 1,753 times
0
-
7http://stackoverflow.com/questions/5087831/how-should-i-set-default-python-version – Vincent Rodomista Jun 23 '16 at 19:47
2 Answers
2
You can specify the path of the versions explicitly:
> C:\Python27\python
or
> C:\Python34\python

Moses Koledoye
- 77,341
- 8
- 133
- 139
-
i tried but its not working even i go to python34 its still enter into 2.7 – kiran_raj_r Jun 24 '16 at 14:04
-
-
c:\Python34>python Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> – kiran_raj_r Jun 24 '16 at 14:08
-
See if the path to your Python3 is included in the `PATH` environment variable. In any case , you can search for `Python 3.4` in windows search to use the command line of Python 3 dierectly – Moses Koledoye Jun 24 '16 at 14:20
-
thanks it worked but what i need is as i am working in different directory;in that directory can i change between versions ? – kiran_raj_r Jun 24 '16 at 14:32
-
You should be able to change, if you're in the main cmd prompt. – Moses Koledoye Jun 24 '16 at 14:40
1
One other option is to use virtualenv
http://pypi.python.org/pypi/virtualenv
It helps you by managing/switching between several virtual Python environments.

Mo H.
- 1,788
- 1
- 18
- 28