解決國內安裝tensorflow, opencv等安裝不成功或下載太慢問題(親自測試了一下,清華大學的超級快(使用后面帶-i的方法,無需修改默認下載地址)。我等一晚上無法下載的,3秒內解決問題)


解決國內安裝tensorflow, opencv等安裝不成功或下載太慢問題

復制自博客:https://blog.csdn.net/jorg_zhao/article/details/80075293

1.安裝tensorflow官方方法與使用國內源方法

1.1 官方安裝方法-適用FQ
tensorflow安裝方法比較常見,參考谷歌的官方教程,安裝方法如下:

python2版本的安裝
pip install --upgrade tensorflow      # for Python 2.*
pip install --upgrade tensorflow-gpu  # for Python 2.* and GPU
python3版本的安裝
pip3 install --upgrade tensorflow     # for Python 3.*
pip3 install --upgrade tensorflow-gpu # for Python 3.* and GPU
.2 國內源方法-無需FQ

但是國內網絡問題,網速非常慢,如果沒有FQ,可以按照下面方法快速安裝

# python2版本的快速安裝
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow      # for Python 2.*
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow-gpu  # for Python 2.* and GPU
# python3版本的快速安裝
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow     # for Python 3.*
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ --upgrade tensorflow-gpu # for Python 3.* and GPU
以上是使用清華的鏡像源地址,也可使用下面的鏡像地址替換清華源地址:
 
阿里雲 
http://mirrors.aliyun.com/pypi/simple/
 
中國科技大學 
https://pypi.mirrors.ustc.edu.cn/simple/
 
豆瓣(douban) 
http://pypi.douban.com/simple/
 
清華大學 
https://pypi.tuna.tsinghua.edu.cn/simple/
 
中國科學技術大學 
http://pypi.mirrors.ustc.edu.cn/simple/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM