How do I get Anaconda3 to see Python 2.7 after installing it?
So I created Anaconda (3) on my Windows 8 machine, it worked without issue. Now I also need a Python 2 installation, so I created an additional environment accordingly. Unfortunately, after activating this environment, the python interpreter it sees remains unchanged. What am I doing wrong? (Shortened) console output:
C:\Users\me\AppData\Local\Continuum\Anaconda3>conda create -n py27 python=2.7 anaconda
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment C:\Users\me\AppData\Local\Continuum\Anaconda3\envs\py27:
<snip>
The following NEW packages will be INSTALLED:
_license: 1.1-py27_0
anaconda: 2.1.0-np19py27_0
<snip>
python: 2.7.8-0
<snip>
Proceed ([y]/n)? y
menuinst-1.0.4 100% |###############################| Time: 0:00:00 239.25 kB/s
Fetching packages ...
_license-1.1-p 100% |###############################| Time: 0:00:00 432.62 kB/s
anaconda-2.1.0 100% |###############################| Time: 0:00:00 150.62 kB/s
<snip>
Extracting packages ...
[ COMPLETE ] |#################################################| 100%
Linking packages ...
[ COMPLETE ] |#################################################| 100%
#
# To activate this environment, use:
# > activate py27
#
C:\Users\me\AppData\Local\Continuum\Anaconda3>python --version
Python 3.4.1 :: Anaconda 2.1.0 (64-bit)
C:\Users\me\AppData\Local\Continuum\Anaconda3>activate py27
Activating environment "py27"...
[py27] C:\Users\me\AppData\Local\Continuum\Anaconda3>python --version
Python 3.4.1 :: Anaconda 2.1.0 (64-bit)
<why isn't python 2.7.8 visible here??>
Execution echo %PATH%
before and after activation gives this output
C:\Users\me\AppData\Local\Continuum\Anaconda3>echo %PATH%
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows
\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Fi
les (x86)\PDFtk\bin\;C:\Users\me\AppData\Local\Continuum\Anaconda3;C:\Users\me\AppData\Local\Continuum\Anaconda3\Scripts
C:\Users\me\AppData\Local\Continuum\Anaconda3>python --version
Python 3.4.1 :: Anaconda 2.1.0 (64-bit)
C:\Users\me\AppData\Local\Continuum\Anaconda3>activate py27
Activating environment "py27"...
[py27] C:\Users\me\AppData\Local\Continuum\Anaconda3>echo %PATH%
C:\Users\me\AppData\Local\Continuum\Anaconda3\envs\py27;C:\Users\me\AppData\Local\Continuum\Anaconda3\envs\py27\Scripts;C:
\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\S
ystem32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program File
s (x86)\PDFtk\bin\;C:\Users\me\AppData\Local\Continuum\Anaconda3;C:\Users\me\AppData\Local\Continuum\Anaconda3\Scripts
[py27] C:\Users\me\AppData\Local\Continuum\Anaconda3>python --version
Python 3.4.1 :: Anaconda 2.1.0 (64-bit)
It looks right. Also, python.exe
in \envs\py27\python.exe
is 2.7.8 Python!
source to share
On Windows, the current path takes precedence over the variable PATH
when referring to binaries. Therefore, since you are still in the catalog Anaconda3
, containing python.exe
, cmd
choose it instead of looking it over PATH
, which would be returned to the executable file Python 2.7. cd
the other way and you're fine.
source to share