I used Anaconda for python.
python2 is installed in D:\Python\Anaconda2
python3 is installed in D:\Python\Anaconda3
python3 is the default.
created two environmental variables with name: python2
and python2
and selected respective python.exe
from different folder respectively.
my setup.py supports only python2.
when i run command from cmd python setup.py install
it says it does not support. If I rename D:\Python\Anaconda2\python.exe
to D:\Python\Anaconda2\python2.exe
and change the environment path file accordingly it works. But I dnt want to change the file name (as it may break other apps, like conda says unable to create process, etc).
Windows 10 Pro, 64 bit. setup.py location: E:\Program Files\IBM\ILOG\CPLEX_Studio1251\cplex\python\x64_win64
How to overcome this? Want python2 setup.py install
for python2 compiler and python3 setup.py install
for python3 compiler, without renaming.
How to install setup.py by running D:\Python\Anaconda2\python.exe
?
I'm not sure whether this directly answers your question,but anaconda manages environments for you. Reference
You should be able to type into your Anaconda prompt to create your environment:
conda create --name pyenv python=2.7
and then list your environments:
conda info --envs
and lastly activate your environment python 2 or python 3 environments:
activate pyenv
These separate environments with their own versions of python are saved in the anaconda folder under the envs folder
/Anaconda3/envs/pyenv/python
Here is how you can use both python2 and python3 in windows 10
Enter windows keys and type "Edit the system environment variables"
Save and exit.
Now,
If you want it otherwise, update executable file of python2 to python2 instead of python. And update PATH variables to list python2 and python3 in order.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.