一、Anacond 是一個python的發行版,包括了python和不少常見的軟件庫, 和一個包管理器conda。常見的科學計算類的庫都包含在裏面了,使得安裝比常規python安裝要容易。python
二、Anaconda是專一於數據分析的Python發行版本,包含了conda、Python等190多個科學包及其依賴項。json
下載地址:www.anaconda.com/download/bash
Anacond是跨平臺的,同時支持Windows、macOS、Linux,我這裏下載的是Windows X64的安裝包工具
雙擊下載的安裝包 測試
一步步的Next,這裏注意下,官方不建議咱們把conda加入到環境變量,不加就不加唄,按照他的來,我這裏默認安裝的是python3.7的因此默認就是python3.7了,好了我們繼續Next,因爲Anacond裏面包含了大量的python的包,大概佔用2G的硬盤容量,因此這裏選擇安裝位置根據本身實際狀況來定。 this
安裝須要一段時間,請耐心等待....url
conda --version
,若是顯示對應的版本信息,那麼Anaconda3就安裝成功了。
在系統環境變量path
中須要添加三個目錄,以下(安裝目錄替換下)
E:\Tool\Anaconda3
E:\Tool\Anaconda3\Scripts
E:\Tool\Anaconda3\Library\bin
而後win+R
打開cmd命令,執行conda --version
和python --version
,查看是否能獲得和上面同樣的conda的版本信息。spa
清華鏡像1 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
代理
清華鏡像2 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
code
中科大鏡像 conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
檢查配置
一、打開配置 conda config --set show_channel_urls yes
二、檢查配置 conda config --show channels
配置完成後會在該目錄C:\Users\<你的用戶名>
下生成一個對應的.condarc
文件
一、建立一個名爲python27的環境,指定Python版本是2.7(不用管是2.7.x,conda會爲咱們自動尋找2.7.x中的最新版本) conda create --name python27 python=2.7
一、建立一個名爲python37的環境,指定Python版本是3.7(不用管是3.7.x,conda會爲咱們自動尋找3.7.x中的最新版本) conda create --name python37 python=3.7
C:\Users\Administrator>conda create --name python37 python=3.7
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch/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.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.tuna.tsinghua.edu.cn\', port=443): Max retries exceeded with url: /anaconda/cloud/msys2/noarch/repodata.json (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))')) 複製代碼
若是出現了相似的錯誤,網上說配置下清華或者中科大的鏡像地址就能夠了,我配置了發現仍是不行,個人處理方式是,打開Anaconda Navigator
經過界面去添加對應的虛擬環境然,若是仍是出現上面相似的錯誤,檢查下你是否開啓了代理工具,若是開啓了先比代理工具,而後再測試下
.condarc
文件,發現配置裏面多了一個ssl_verify的配置,以下是完整的配置,若是你也出現了相似的狀況那麼直接把 ssl_verify: true
添加上,應該就能夠了,這裏我沒有去是,理論上應該是這樣的。channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- defaults
show_channel_urls: true
ssl_verify: true
複製代碼
# 安裝第三方包
conda install requests
pip install requests
# 卸載第三方包
conda remove requests
pip uninstall requests
複製代碼