简体   繁体   中英

Can't pip install packages in Anaconda

I broke conda somehow by updating it. If there was a package pack that I couldn't get using

conda install pack

I could do

pip install pack

and everything worked great. That package would then be accessible from the python in anaconda/bin/python.

After running conda update conda, pip corresponds not to the conda environment but to the base python on osx (I think).

 which pip
 /usr/local/bin/pip

I tried navigating to the pip package in the anaconda folder. But even running

 pip install pack

from there installs the package in /Library/Python/2.7/site-packages and not in //anaconda. Any ideas on how to fix this? Thanks!

Edited:

 which conda
 /Users/Ben/anaconda/bin/conda

echo$PATH

bash:echo/Users/Ben/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin://anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Ben/anaconda/bin:/opt/X11/bin:/usr/texbin: No such file or directory

尝试使用conda update pipconda update -f pip强制执行。

You should get rid of the original OS python pip, use:

With Debian / Ubuntu :

sudo apt-get purge python-pip

With Redhat / Centos / Fedora :

sudo yum remove python-pip

That was referenced here: https://unix.stackexchange.com/questions/187701/how-do-i-correct-the-path-for-pip

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM