【pip】【conda】

一、指定python包安裝版本==  指定python包安裝源-i:

pip2 install matplotlib==2.2.3 -i https://pypi.tuna.tsinghua.edu.cn/simple

 

二、配置文件换源

vi ~/.pip/pip.conf

[global]

timeout = 6000

index-url = http://pypi.douban.com/simple/

[install]

use-mirrors = true

mirrors = http://pypi.douban.com/simple/

trusted-host = pypi.douban.com

 

 

三、为python setup.py install命令换源

vi ~/.pydistutils.cfg

[easy_install]
index_url = http://pypi.douban.com/simple

 

 

 

 

pip

Ubuntu系统内置python2.7,为python2安装pip:

sudo apt-get install python-pip  python


python3安装pip:

sudo apt-get install python3-pip  

注意:上面两条命令安装过程当中可能报错,我运行的时候报错提示 unable to fetch archives...try apt-get update or --fix-missing

才反应过来:

使用apt-get以前须要先更新一下apt-get:执行sudo apt-get update,再执行安装,便可

 

安装conda

https://www.continuum.io/downloadsbash

http://blog.csdn.net/qq_26898461/article/details/51485491python2.7

从官网下载安装包(.sh文件),运行便可,中间会提示你是否赞成用户协议,询问你安装路径,询问你是否要将 %condahome%/bin加入环境变量,询问你是否还要安装其捆绑软件vscode。fetch

安装完成后,执行conda命令,发现command not found:url

-bash: conda: command not foundspa

猜想多是配置的环境变量还没生效?因而进入%condahome%/bin而后执行conda命令,发现出现了更加奇怪的错误:.net

from: can't read /var/mail/conda.clicode

bash: ./conda: line 10: syntax error near unexpected token `('blog

bash: ./conda: line 10: `    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])'token

最后发现是由于安装完成后须要关闭而后从新打开一个terminal才能使用conda命令!

卸载conda(anaconda)

http://blog.csdn.net/qq_22474567/article/details/54984257

相关文章
相关标签/搜索