试了找到的帖子里面的所有办法,一直WARNING、ERROR,之前放弃了很多次,但是没有办法不能再拖了。。。也看了Python是不是64位。用了清华镜像,可能是网络问题一直没对。终于试了这个方法成功了:https://blog.csdn.net/weixin_42840933/article/details/85308265
豆瓣镜像 +获得ssl认证(输入指令后就去上课了,不知道行不行,很绝望,回来居然安装好了,泪目)(因为还在下其他视频所以挂了vpn,不知道有没有必要)
不知道ssl认证是啥,搜了一下https://baike.baidu.com/item/SSL%E8%AE%A4%E8%AF%81/6399053
安装是在 Anaconda Prompt里面:
pip install tensorflow -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
(base) C:\Users\Administrator>pip install tensorflow -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='127.0.0.1', port=1196): Read timed out. (read timeout=15)")': http://pypi.douban.com/simple/tensorflow/
Collecting tensorflow
Downloading http://pypi.doubanio.com/packages/ad/fc/fccaa149d7ccc165de01d62d19e5e9492e87ad23a7106f6dfe132800ca6f/tensorflow-2.4.1-cp38-cp38-win_amd64.whl (370.7 MB)
|████████████████████████████████| 370.7 MB 544 kB/s
Requirement already satisfied: h5py~=2.10.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (2.10.0)
Collecting grpcio~=1.32.0
Downloading http://pypi.doubanio.com/packages/d9/41/be8f5e0acc98a134ac149f570d953b98a65ecf25989e63ba90fd6b7cff4b/grpcio-1.32.0-cp38-cp38-win_amd64.whl (2.6 MB)
|████████████████████████████████| 2.6 MB 261 kB/s
Collecting opt-einsum~=3.3.0
Downloading http://pypi.doubanio.com/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB)
|████████████████████████████████| 65 kB 218 kB/s
Requirement already satisfied: typing-extensions~=3.7.4 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (3.7.4.3)
Requirement already satisfied: numpy~=1.19.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.19.2)
Requirement already satisfied: six~=1.15.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.15.0)
Collecting google-pasta~=0.2
Downloading http://pypi.doubanio.com/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57 kB)
|████████████████████████████████| 57 kB 1.3 MB/s
Collecting keras-preprocessing~=1.1.2
Downloading http://pypi.doubanio.com/packages/79/4c/7c3275a01e12ef9368a892926ab932b33bb13d55794881e3573482b378a7/Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
|████████████████████████████████| 42 kB 163 kB/s
Collecting protobuf>=3.9.2
Downloading http://pypi.doubanio.com/packages/2a/45/59dfbd1f70f541a021e679cc084a70a342ca59d3a0d5e9d05cff5a7f2b9e/protobuf-3.15.7-py2.py3-none-any.whl (173 kB)
|████████████████████████████████| 173 kB 819 kB/s
Requirement already satisfied: wheel~=0.35 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.35.1)
Collecting termcolor~=1.1.0
Downloading http://pypi.doubanio.com/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz (3.9 kB)
Collecting gast==0.3.3
Downloading http://pypi.doubanio.com/packages/d6/84/759f5dd23fec8ba71952d97bcc7e2c9d7d63bdc582421f3cd4be845f0c98/gast-0.3.3-py2.py3-none-any.whl (9.7 kB)
Collecting tensorboard~=2.4
Downloading http://pypi.doubanio.com/packages/64/21/eebd23060763fedeefb78bc2b286e00fa1d8abda6f70efa2ee08c28af0d4/tensorboard-2.4.1-py3-none-any.whl (10.6 MB)
|████████████████████████████████| 10.6 MB 1.3 MB/s
Collecting wrapt~=1.12.1
Downloading http://pypi.doubanio.com/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz (27 kB)
Collecting astunparse~=1.6.3
Downloading http://pypi.doubanio.com/packages/2b/03/13dde6512ad7b4557eb792fbcf0c653af6076b81e5941d36ec61f7ce6028/astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting tensorflow-estimator<2.5.0,>=2.4.0
Downloading http://pypi.doubanio.com/packages/74/7e/622d9849abf3afb81e482ffc170758742e392ee129ce1540611199a59237/tensorflow_estimator-2.4.0-py2.py3-none-any.whl (462 kB)
|████████████████████████████████| 462 kB 930 kB/s
Collecting flatbuffers~=1.12.0
Downloading http://pypi.doubanio.com/packages/eb/26/712e578c5f14e26ae3314c39a1bdc4eb2ec2f4ddc89b708cf8e0a0d20423/flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
Collecting absl-py~=0.10
Downloading http://pypi.doubanio.com/packages/92/c9/ef0fae29182d7a867d203f0eff8296b60da92098cc41db33a434f4be84bf/absl_py-0.12.0-py3-none-any.whl (129 kB)
|████████████████████████████████| 129 kB 595 kB/s
Collecting markdown>=2.6.8
Downloading http://pypi.doubanio.com/packages/6e/33/1ae0f71395e618d6140fbbc9587cc3156591f748226075e0f7d6f9176522/Markdown-3.3.4-py3-none-any.whl (97 kB)
|████████████████████████████████| 97 kB 1.7 MB/s
Collecting tensorboard-plugin-wit>=1.6.0
Downloading http://pypi.doubanio.com/packages/1a/c1/499e600ba0c618b451cd9c425ae1c177249940a2086316552fee7d86c954/tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781 kB)
|████████████████████████████████| 781 kB 1.7 MB/s
Requirement already satisfied: werkzeug>=0.11.15 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (1.0.1)
Requirement already satisfied: setuptools>=41.0.0 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (50.3.1.post20201107)
Collecting google-auth<2,>=1.6.3
Downloading http://pypi.doubanio.com/packages/b5/ef/13d3b65c41ddde1a57e89de6adfc610093d109ebd472545a33e76dcdd8bf/google_auth-1.28.0-py2.py3-none-any.whl (136 kB)
|████████████████████████████████| 136 kB 819 kB/s
Collecting google-auth-oauthlib<0.5,>=0.4.1
Downloading http://pypi.doubanio.com/packages/9d/d3/7541e89f1fc456eef157224f597a8bba22589db6369a03eaba68c11f07a0/google_auth_oauthlib-0.4.4-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: requests<3,>=2.21.0 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (2.24.0)
Collecting pyasn1-modules>=0.2.1
Downloading http://pypi.doubanio.com/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
|████████████████████████████████| 155 kB 467 kB/s
Collecting rsa<5,>=3.1.4
Downloading http://pypi.doubanio.com/packages/e9/93/0c0f002031f18b53af7a6166103c02b9c0667be528944137cc954ec921b3/rsa-4.7.2-py3-none-any.whl (34 kB)
Collecting cachetools<5.0,>=2.0.0
Downloading http://pypi.doubanio.com/packages/bb/72/8df2e0dc991f1a1d2c6869404e7622e8ee50d80bff357dbb57c3df70305b/cachetools-4.2.1-py3-none-any.whl (12 kB)
Collecting requests-oauthlib>=0.7.0
Downloading http://pypi.doubanio.com/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB)
Collecting pyasn1<0.5.0,>=0.4.6
Downloading http://pypi.doubanio.com/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
|████████████████████████████████| 77 kB 1.3 MB/s
Requirement already satisfied: idna<3,>=2.5 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2020.6.20)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (1.25.11)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (3.0.4)
Collecting oauthlib>=3.0.0
Downloading http://pypi.doubanio.com/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147 kB)
|████████████████████████████████| 147 kB 66 kB/s
Building wheels for collected packages: termcolor, wrapt
Building wheel for termcolor (setup.py) ... done
Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4835 sha256=69419ea2cc8a0e90136222a2172ab131eb4ee0042c392a2fd8914c1d1fe791fb
Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\76\d4\7e\16cb0b889c0f014a026d097fa782ea32bb4d1fe4b731bc3b7a
Building wheel for wrapt (setup.py) ... done
Created wheel for wrapt: filename=wrapt-1.12.1-cp38-cp38-win_amd64.whl size=33700 sha256=b50eb051f66cb6c5e9625c265aaae86e9c194fed6bb91e154b09755f4d21170a
Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\a4\f6\49\e969a24d4cecb94b1c96a2d37dc4e45d96a3ec0e2e485cd11a
Successfully built termcolor wrapt
Installing collected packages: pyasn1, rsa, pyasn1-modules, oauthlib, cachetools, requests-oauthlib, google-auth, tensorboard-plugin-wit, protobuf, markdown, grpcio, google-auth-oauthlib, absl-py, wrapt, termcolor, tensorflow-estimator, tensorboard, opt-einsum, keras-preprocessing, google-pasta, gast, flatbuffers, astunparse, tensorflow
Attempting uninstall: wrapt
Found existing installation: wrapt 1.11.2
Uninstalling wrapt-1.11.2:
Successfully uninstalled wrapt-1.11.2
Successfully installed absl-py-0.12.0 astunparse-1.6.3 cachetools-4.2.1 flatbuffers-1.12 gast-0.3.3 google-auth-1.28.0 google-auth-oauthlib-0.4.4 google-pasta-0.2.0 grpcio-1.32.0 keras-preprocessing-1.1.2 markdown-3.3.4 oauthlib-3.1.0 opt-einsum-3.3.0 protobuf-3.15.7 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-oauthlib-1.3.0 rsa-4.7.2 tensorboard-2.4.1 tensorboard-plugin-wit-1.8.0 tensorflow-2.4.1 tensorflow-estimator-2.4.0 termcolor-1.1.0 wrapt-1.12.1
(base) C:\Users\Administrator>python
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
2021-04-07 17:56:40.292006: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-04-07 17:56:40.292385: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>>
然后在cmd中确认了一下:
C:\Users\Administrator>pip install tensorflow
Requirement already satisfied: tensorflow in c:\programdata\anaconda3\lib\site-packages (2.4.1)
Requirement already satisfied: typing-extensions~=3.7.4 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (3.7.4.3)
Requirement already satisfied: grpcio~=1.32.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.32.0)
Requirement already satisfied: wrapt~=1.12.1 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.12.1)
Requirement already satisfied: flatbuffers~=1.12.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.12)
Requirement already satisfied: google-pasta~=0.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.2.0)
Requirement already satisfied: numpy~=1.19.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.19.2)
Requirement already satisfied: protobuf>=3.9.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (3.15.7)
Requirement already satisfied: termcolor~=1.1.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: six~=1.15.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.15.0)
Requirement already satisfied: wheel~=0.35 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.35.1)
Requirement already satisfied: gast==0.3.3 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.3.3)
Requirement already satisfied: tensorboard~=2.4 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (2.4.1)
Requirement already satisfied: opt-einsum~=3.3.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (3.3.0)
Requirement already satisfied: h5py~=2.10.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (2.10.0)
Requirement already satisfied: absl-py~=0.10 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (0.12.0)
Requirement already satisfied: tensorflow-estimator<2.5.0,>=2.4.0 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (2.4.0)
Requirement already satisfied: keras-preprocessing~=1.1.2 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.1.2)
Requirement already satisfied: astunparse~=1.6.3 in c:\programdata\anaconda3\lib\site-packages (from tensorflow) (1.6.3)
Requirement already satisfied: markdown>=2.6.8 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (3.3.4)
Requirement already satisfied: requests<3,>=2.21.0 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (2.24.0)
Requirement already satisfied: werkzeug>=0.11.15 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (1.0.1)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (1.8.0)
Requirement already satisfied: google-auth<2,>=1.6.3 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (1.28.0)
Requirement already satisfied: setuptools>=41.0.0 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (50.3.1.post20201107)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\programdata\anaconda3\lib\site-packages (from tensorboard~=2.4->tensorflow) (0.4.4)
Requirement already satisfied: rsa<5,>=3.1.4 in c:\programdata\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (4.7.2)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in c:\programdata\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (4.2.1)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\programdata\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (0.2.8)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\programdata\anaconda3\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow) (1.3.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in c:\programdata\anaconda3\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard~=2.4->tensorflow) (0.4.8)
Requirement already satisfied: certifi>=2017.4.17 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (1.25.11)
Requirement already satisfied: idna<3,>=2.5 in c:\programdata\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard~=2.4->tensorflow) (2.10)
Requirement already satisfied: oauthlib>=3.0.0 in c:\programdata\anaconda3\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.4->tensorflow) (3.1.0)
C:\Users\Administrator>
泪目!!!