包已经在 ./anaconda/lib/python2.7/site-packages 中,我如何在 usr/local/lib/python2.7 中安装它?

Packages already in ./anaconda/lib/python2.7/site-packages, how can I install it in usr/local/lib/python2.7?

我在./anaconda/lib/python2.7/site-packages 中安装了一个包,如何在/usr/local/lib/python2.7/site-packages 中再次安装它? 我用

pip install -U nltk

但它显示

Requirement already up-to-date: nltk in ./anaconda/lib/python2.7/site-packages

我正在使用 Mac OsX 10.10.5

您已经通过在 $PATH 和 $PYTHONPATH 的环境变量中包含 anaconda 激活了 anaconda,例如 .bashrc,具体取决于您的 shell。 只需删除或评论即可。

激活后,

  • $哪个python
  • /home/id/anaconda3/bin/python

没有激活,

  • $哪个python
  • /usr/bin/python

然后你可以在/usr/lib/python2.7/dist-package/

下安装python包