我刚刚在Mac OSX Mavericks上下载并安装了anaconda 3.6.2,现在需要安装一个名为seaborn
的包,这个包并没有预先安装在anaconda中。
$ conda install seaborn
Fetching package metadata: ..
Error: No packages found in current osx-64 channels matching: seaborn
You can search for this package on Binstar with
binstar search -t conda seaborn
You may need to install the Binstar command line client with
conda install binstar
接下来我尝试使用pip
安装这个包。
$ which pip
/Users/username/anaconda/bin/pip
$ pip install seaborn
Could not find an activated virtualenv (required).
尝试再次激活
root
Anaconda环境,但仍然无法工作。$ source activate root
discarding /Users/username/anaconda/bin from PATH
prepending /Users/username/anaconda/bin to PATH
$ pip install seaborn
Could not find an activated virtualenv (required).
接下来我尝试激活虚拟环境,pip install
生效了。
workon testEnv
pip install seaborn
我从Anaconda的启动器中启动了iPython笔记本。但似乎找不到seaborn
包!
seaborn
包是否已经安装?
在~/bashprofile
中,我有:
# virutalenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /Users/username/.virtualenvs/datasci/bin/virtualenvwrapper.sh
# added by Anaconda 2.0.1 installer
export PATH="/Users/username/anaconda/bin:$PATH"
更新
删除了2个virtualenvwrapper行,重新加载了.bash_profile,但是pip install
仍然出现错误:Could not find an activated virtualenv (required).
激活其他conda环境source activate testenv
也没有帮助。
$ source activate ~/.bash_profile
$ pip install seaborn
Could not find an activated virtualenv (required).
$ source activate testenv
discarding /Users/username/anaconda/bin from PATH
prepending /Users/username/anaconda/envs/testenv/bin to PATH
$ pip install seaborn
Could not find an activated virtualenv (required).