3.28~tensorflow安裝(win

anaconda 安裝遇到的問題

windows環(huán)境變量需要設(shè)置

python命令老是彈出微軟商店

刪除以下環(huán)境變量(PATH)
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;

1.pip版本更新解決辦法:使用國內(nèi)的源下載:

python -m pip install --upgrade pip -i [https://pypi.douban.com/simple](https://pypi.douban.com/simple)

2.安裝步驟

(1)傻瓜式安裝Anaconda3.5
(2)打開Anaconda prompt,進去pip安裝需要的包或者conda環(huán)境
(3)創(chuàng)建虛擬環(huán)境,并且指定環(huán)境名
conda create -n tensorflow python=3.5
(4)激活新環(huán)境
activate tensorflow
(5)安裝tensorflow
pip install tensorflow==1.15.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

或者(從清華鏡像源下載)
pip install tensorflow-gpu==1.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple #可改成任意版本

3.查看TensorFlow安裝版本和路徑|驗證安裝成功與否:

由于Tensorflow版本不同,可能一些函數(shù)的調(diào)用也有變換,這時候可能需要查看Tensorflow版本,可以在終端輸入查詢命令如下:

python
import tensorflow as tf
tf.__version__
tf.__path__  #查詢tensorflow安裝路徑

注意:直接pip往往太慢了,從豆瓣或者清華鏡像下載
豆瓣鏡像源https://pypi.douban.com/simple/
清華鏡像源https://pypi.tuna.tsinghua.edu.cn/simple
示例代碼安裝keras(注意:–user代表安裝在個人目錄下,不影響root目錄)
pip3 install keras -i https://pypi.douban.com/simple/ --user

遇到的問題:
1.mac的tensorflow版本和windows是不一樣的——windows10
pip install tensorflow==1.15.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
2.遇到找不到包問題:
例如:ERROR: Could not find a version that satisfies the requirement simplejson (from versions: none)
python -m pip install --upgrade pip
pip install PyHamcrest -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

3.需要卸載的包:ERROR: Cannot uninstall 'wrapt'
pip install wrapt --ignore-installed

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容