pip --proxy 127.0.0.1:25378 install tensorflow-2.0.0-cp36-cp36m-win_amd64.whl
pip裝東西經常下載失敗,網上搜了一下發現了兩個方法:
一個是下載下來安裝,一個掛代理。(下載下來安裝,有的時候缺失依賴包,還是要掛代理下載)
其中--proxy 127.0.0.1:25378
可以輸入代理ip和代理工具的端口
install後面,可以是包名,也可以是下載好的包安裝文件。
=======================
結果發現還是報錯,因爲python用的是Anacoda,所以直接用conda安裝試試。
爲了提升下載速度,添加了清華源。
查看源:conda config --show-sources
清華源:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
設置搜索時顯示通道地址:conda config --set show_channel_urls yes
最後安裝成功
————————————————
conda install tensorflow
Collecting package metadata: done
Solving environment: done # 這一步等待時間漫長,耐心等待
==> WARNING: A newer version of conda exists. <==
current version: 4.6.14
latest version: 4.7.12
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: C:\Users\yourname\Anaconda3
added / updated specs:
- tensorflow
The following packages will be downloaded:
package | build
---------------------------|-----------------
anaconda-custom | py36_0 13 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
backports.weakref-1.0rc1 | py36_0 8 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
blas-1.0 | mkl 6 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
bleach-1.5.0 | py36_0 22 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
ca-certificates-2019.10.16 | 0 163 KB defaults
certifi-2019.9.11 | py36_0 155 KB defaults
cryptography-1.8.1 | py36_0 350 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
curl-7.52.1 | vc14_0 322 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
html5lib-0.9999999 | py36_0 178 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
libprotobuf-3.2.0 | vc14_0 9.1 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
libssh2-1.8.0 | vc14_0 189 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
markdown-2.6.9 | py36_0 100 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
openssl-1.0.2l | vc14_0 5.1 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
protobuf-3.2.0 | py36_0 459 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pycurl-7.43.0 | py36_2 55 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pyopenssl-17.0.0 | py36_0 76 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
tensorflow-1.2.1 | py36_0 21.0 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vs2015_runtime-14.0.25420 | 0 2.0 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
------------------------------------------------------------
Total: 39.3 MB
The following NEW packages will be INSTALLED:
backports.weakref anaconda/pkgs/free/win-64::backports.weakref-1.0rc1-py36_0
blas anaconda/pkgs/free/win-64::blas-1.0-mkl
libprotobuf anaconda/pkgs/free/win-64::libprotobuf-3.2.0-vc14_0
markdown anaconda/pkgs/free/win-64::markdown-2.6.9-py36_0
protobuf anaconda/pkgs/free/win-64::protobuf-3.2.0-py36_0
tensorflow anaconda/pkgs/free/win-64::tensorflow-1.2.1-py36_0
The following packages will be UPDATED:
ca-certificates 2017.08.26-h94faf87_0 --> 2019.10.16-0
certifi 2018.1.18-py36_0 --> 2019.9.11-py36_0
vs2015_runtime pkgs/main::vs2015_runtime-14.0.25123-3 --> anaconda/pkgs/free::vs2015_runtime-14.0.25420-0
The following packages will be SUPERSEDED by a higher-priority channel:
anaconda pkgs/main::anaconda-5.1.0-py36_2 --> anaconda/pkgs/free::anaconda-custom-py36_0
bleach pkgs/main::bleach-2.1.2-py36_0 --> anaconda/pkgs/free::bleach-1.5.0-py36_0
cryptography pkgs/main::cryptography-2.1.4-py36he1~ --> anaconda/pkgs/free::cryptography-1.8.1-py36_0
curl pkgs/main::curl-7.58.0-h7602738_0 --> anaconda/pkgs/free::curl-7.52.1-vc14_0
html5lib pkgs/main::html5lib-1.0.1-py36h047fa9~ --> anaconda/pkgs/free::html5lib-0.9999999-py36_0
libssh2 pkgs/main::libssh2-1.8.0-hd619d38_4 --> anaconda/pkgs/free::libssh2-1.8.0-vc14_0
openssl pkgs/main::openssl-1.0.2n-h74b6da3_0 --> anaconda/pkgs/free::openssl-1.0.2l-vc14_0
pycurl pkgs/main::pycurl-7.43.0.1-py36h74b6d~ --> anaconda/pkgs/free::pycurl-7.43.0-py36_2
pyopenssl pkgs/main::pyopenssl-17.5.0-py36h5b7d~ --> anaconda/pkgs/free::pyopenssl-17.0.0-py36_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
ca-certificates-2019 | 163 KB | ############################################################################ | 100%
openssl-1.0.2l | 5.1 MB | ############################################################################ | 100%
protobuf-3.2.0 | 459 KB | ############################################################################ | 100%
pyopenssl-17.0.0 | 76 KB | ############################################################################ | 100%
libprotobuf-3.2.0 | 9.1 MB | ############################################################################ | 100%
anaconda-custom | 13 KB | ############################################################################ | 100%
certifi-2019.9.11 | 155 KB | ############################################################################ | 100%
html5lib-0.9999999 | 178 KB | ############################################################################ | 100%
tensorflow-1.2.1 | 21.0 MB | ############################################################################ | 100%
bleach-1.5.0 | 22 KB | ############################################################################ | 100%
markdown-2.6.9 | 100 KB | ############################################################################ | 100%
vs2015_runtime-14.0. | 2.0 MB | ############################################################################ | 100%
libssh2-1.8.0 | 189 KB | ############################################################################ | 100%
blas-1.0 | 6 KB | ############################################################################ | 100%
backports.weakref-1. | 8 KB | ############################################################################ | 100%
pycurl-7.43.0 | 55 KB | ############################################################################ | 100%
curl-7.52.1 | 322 KB | ############################################################################ | 100%
cryptography-1.8.1 | 350 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: / DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Users\yourname\Anaconda3', env_name: 'None', mode: 'None', used_mode: 'user'
DEBUG menuinst_win32:create(323): Shortcut cmd is C:\Users\yourname\Anaconda3\pythonw.exe, args are ['-m', 'webbrowser', '-t', '"https://anaconda.org/"']
done
C:\Users\yourname\Downloads>