解決國內安裝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/