On
- Conda 4.2.13
- Mac OS X v10.12.1 (Sierra)
I am trying to install packages from pip to a fresh environment (virtual) created using anaconda. In the Anaconda documentation it says this is perfectly fine. It is done the same way as for virtualenv.
Activate the environment where you want to put the program, then pip install a program...
I created an empty environment in Anaconda like this:
conda create -n shrink_venv
Activate it:
source activate shrink_venv
I then can see in the terminal that I am working in my environment (shrink_venv). A problem is coming up when I try to install a package using pip:
pip install Pillow
Output:
Requirement already satisfied (use --upgrade to upgrade): Pillow in /Library/Python/2.7/site-packages
So I can see it thinks the requirement is satisfied from the system-wide package. So it seems the environment is not working correctly, definitely not like it said in the documentation. Am I doing something wrong here?
Just a note, I know you can use conda install for the packages, but I have had an issue with Pillow from anaconda, so I wanted to get it from pip, and since the docs say that is fine.
Output of which -a pip:
/usr/local/bin/pip
/Users/my_user/anaconda/bin/pip
I see this is pretty common issue. I have found that the Conda environment doesn't play well with the PYTHONPATH. The system seems to always look in the PYTHONPATH locations even when you're using a Conda environment. Now, I always run unset PYTHONPATH when using a Conda environment, and it works much better. I'm on a Mac.
]
conda install pip?which -a pipto your question please?PYTHONPATHenvironment variable set?python -m pip install Pillow