System: Ubuntu 16.04
Default result of python -V
: Python 3.6.5 :: Anaconda, Inc.
Default result of which python
: /home/myname/anaconda3/bin/python
I am trying to set up a virtual environment that uses python 2.7 while my default python is python 3.6 through Anaconda. However, after specifying the creation of a new environment from the terminal (conda create -n myenv python=2.7
), my new environment still uses python 3.6.
A similar problem was addressed in these two questions:
and
Why Conda cannot call correct Python version after activating the environment?
but my situation is not fixed by simply changing directories as was the case in those instances.
If I source activate myenv
, python -V still gives me Python 3.6.5 :: Anaconda, Inc. even though which python
does give /home/myname/anaconda3/envs/myenv/bin/python
as expected. Going to this directory and typing ls -l
says this is a pointer to python2.7, so I am not sure where the disconnect is between python -V and which python.
Any idea what is going on or how I can make an environment that actually uses python 2.7?
Thanks!