一、軟件下載
這里是從清華源下載的版本,也可以進(jìn)入選擇適合自己的版本:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Windows-x86_64.exe
當(dāng)然也可以從官網(wǎng)上下載,但速度較慢何恶。
二、安裝
參考:http://www.reibang.com/p/742dc4d8f4c5? ? 有詳細(xì)的過程,這里不做過多的描述
注:這里強(qiáng)調(diào)一下背率,使用Anaconda,對初學(xué)者很重要嫩与,只要有足夠的空間寝姿,就可以不斷試錯,解決各種包可能存在的坑划滋,避免對整機(jī)環(huán)境的影響
三饵筑、我遇到的問題
1、安裝完成后Anaconda會創(chuàng)建一個叫base的默認(rèn)環(huán)境处坪,如果不切換到其他指定環(huán)境根资,就會一直在默認(rèn)環(huán)境運(yùn)行,我這里安排的版本同窘,默認(rèn)的是py3.7版本
C:\Users\chinamobile>conda env list
# conda environments:
#
base? ? ? ? ? ? ? ? ? *? D:\Anaconda3
2玄帕、conda默認(rèn)的源,在國內(nèi)通常比較慢想邦,建議修改為清華源或中科源
conda config--addchannels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config--addchannels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config--setshow_channel_urls yes
3桨仿、更新信息失敗
C:\Users\chinamobile>conda update --all
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectionError(ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out."))
原因:我這里的網(wǎng)絡(luò)需要使用代理,需要給conda添加代理設(shè)置
修改anaconda的配置文件案狠,位置在c:\User\current_user(當(dāng)前用戶)\.condarc服傍,將以下內(nèi)容添加進(jìn)去钱雷, 替換原有內(nèi)容, 修改 http://proxy.yourorg.org:port 為本地的代理地址:
channels:
????- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
????- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
????- defaults
# Show channel URLs when displaying what is going to be downloaded and
# in ‘conda list‘. Thedefault is False.
show_channel_urls: True
allow_other_channels: True
proxy_servers:
? ? http: http://proxy.yourorg.org:port
? ? https: http://proxy.yourorg.org:port
ssl_verify: False
注:
(1)第一個http:和https:后面跟一個空格吹零,ssl_verify:后面也跟一個空格
(2)http:和https:后面的鏈接換成你的代理鏈接和端口號罩抗。
沒有空格會報錯:無效的參數(shù)
4、發(fā)現(xiàn)仍然報錯“CondaHTTPError: HTTP 000 CONNECTION FAILED”
原因:源的配置灿椅,多了一行“- defaults” 套蒂,把這一行刪除即可
注:其它一些類型報錯,可參考?https://www.cnblogs.com/tianlang25/p/12433025.html
5茫蛹、更新一些包的時候報錯:CondaError: Downloaded bytes did not match Content-Length
原因:網(wǎng)絡(luò)比較慢的原因操刀,有時timeout不夠用,可以把這個參數(shù)值放大婴洼,我這里放大到1000
conda?config?--set?remote_read_timeout_secs 1000.0
注:如果仍有一些包會出現(xiàn)這個報錯骨坑,可以直接使用conda install?或pip?安裝