使用conda
conda install xx 包名
存在的问题:
- 速度慢。
conda的源在国外,翻不了墙的话很慢。在网上查了一下可以换清华的镜像,但我试了下貌似没用。贴出来方法。
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yes
或者直接vi ~/.condarc,输入以下内容
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: yes
- 缺少包
可能有些包conda中没有。这时可以用anaconda中的pip来安装(区别于系统的pip)到anaconda中
sudo /anaconda2/bin/pip install xx
速度慢的问题也解决了,可能是因为我的pip源是国内的吧,不是很清楚。