Unable to pip install packages in Anaconda(无法在 Anaconda 中 pip 安装包)
问题描述
刚刚在 Mac OSX Mavericks 上下载并安装了 anaconda 3.6.2,我需要安装一个未预装 anaconda 的包 seaborn
.
Just downloaded and installed anaconda 3.6.2 on Mac OSX Mavericks and I need to install a package seaborn
which is not pre-installed with 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
来安装包
Next I tried to use pip
to install the package
$ which pip
/Users/username/anaconda/bin/pip
$ pip install seaborn
Could not find an activated virtualenv (required).
尝试再次激活 root
Anaconda env,但还是不行
Tried activating root
Anaconda env again, but still does not work
$ 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).
接下来我尝试激活一个 virualenv 并且 pip install
工作正常.
Next I tried activating a virualenv and pip install
works.
workon testEnv
pip install seaborn
现在我从 Anaconda 的启动器启动了 iPython notebook
.但是seaborn
包好像没有找到!
Now I launched iPython notebook
from Anaconda's launcher. But the seaborn
package does not seem to be found!
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 anactivated virtualenv (required).
激活另一个 conda 环境 source activate testenv
没有帮助.
Update
Removed the 2 virtualenvwrapper lines, reloaded .bash_profile, but pip install
still gives the error Could not find an activated virtualenv (required).
Activating another conda environment source activate testenv
does not help.
$ 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).
推荐答案
需要安装anaconda版本的pip.运行:
You need to install the anaconda version of pip. Just run:
conda install pip
这将在激活的 conda 环境中安装 pip
This will install pip inside of the activated conda environment
这篇关于无法在 Anaconda 中 pip 安装包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法在 Anaconda 中 pip 安装包


基础教程推荐
- 包装空间模型 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01