【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

相關文章
相關標籤/搜索