tensorflow貌似只支持python版本,我對python接觸比較少,平時編程都是用的VS,因此對于Anaconda的配置和使用有必要學習一遍。以下內容都是在網上找的。
conda管理
# 確認conda已安裝
conda--version
# 更新conda版本
#其中更新命令不僅僅會更新conda的版本,同時會自動更新相關的包
conda update conda
#也可以使用這個命令來更新Anaconda版本
condaupdate anaconda
環境管理
# 創建新環境
conda create --name python27?python=2.7?pandas
#其中python27代指環境的名稱,此命令主要可以指定版本號,pandas是要在新環境中添加的軟件包,
# 查看當前環境
conda info --envs
#切換環境,我的系統是windows,因此就用windows的命令了
activate python27
# 復制環境
conda create --name python2 --clone python27
# 導出配置文件
conda env export --name python27> python27.yml
# 根據配置文件導入環境
conda env create -f python27.yml
軟件包管理
# 查看所有已安裝的軟件包
conda list
# 查找軟件包
# 羅列出所有可用的版本并在已經安裝的版本前加*
conda search beautifulsoup4
# 安裝軟件包
conda install --name beautifulsoup4=4.4.1
#pip安裝軟件包
pip install XXX
#更新軟件包
conda update --name snowflakes beautifulsoup4=4.5.1
python管理
# 查找可用python版本
conda search --full-name python
#安裝指定版本python,其實前面有了
conda create -n snakes python=3.4
卸載包、環境
# 卸載包
# 刪除指定環境中的指定包
conda remove --name snowflakes biopython
# 卸載環境
# --all參數表示移除環境中的所有軟件包,即刪除整個環境
conda remove --name snakes --all
文章引用自https://www.cnblogs.com/baiyangcao/p/anaconda_basic.html
實際安裝的時候我是按
https://blog.csdn.net/zsf442553199/article/details/78890659
步驟一步步操作的
conda?create?--name tensorflow?python=3.6?
activate tensorflow
conda?config?--add?channels?https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/??
conda?config?--set?show_channel_urls?yes?
pip?install?--upgrade?--ignore-installed?tensorflow??
然后報一個錯?:
Could not find a version that satisfies the requirement tensorflow (from versi
ons: )
No matching distribution found for tensorflow
我后面用python27環境也試了一下,同樣的錯誤。網上有文章說跟anaconda版本有關,我的是4.4.10,文章說的是4.2才行,今天太晚。留待以后再整。