最近在看《用python动手学及其学习》,书中源码的测试环境如下:
OS:Windows10 Manjaro:20211205 pacman -Syyu
Python:3.7.3 3.9.7
Anaconda:4.6.11 Anaconda3 2021.11
Jupyter Notebook:5.7.8
TensorFlow:1.13.1 2.7.0
Keras:2.2.4 2.7.0
一、按照要求安装tensorflow时,特别慢要近3个小时,叔可以忍,婶不能忍
原来:
pip install tensorflow Collecting tensorflow Downloading tensorflow-2.7.0-cp39-cp39-manylinux2010_x86_64.whl (489.7 MB) |▎ | 4.6 MB 28 kB/s eta 4:45:08^C
后来:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow 1 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting tensorflow Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b6/e5/0efd8bcb1a7aa59718335a851715686647e253c835d4178d8a3582b2b0fa/tensorflow-2.7.0-cp39-cp39-manylinux2010_x86_64.whl (489.7 MB) |████████████████████████████████| 489.7 MB 3.1 kB/s Requirement already satisfied: wheel<1.0,>=0.32.0 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (0.37.0) Collecting libclang>=9.0.1 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/76/2d/7b0f7f5519669f11e66028fa227d4bcda4d77411d52d26c661676db82338/libclang-12.0.0-py2.py3-none-manylinux1_x86_64.whl (13.4 MB) |████████████████████████████████| 13.4 MB 8.5 MB/s Collecting absl-py>=0.4.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2c/03/e3e19d3faf430ede32e41221b294e37952e06acc96781c417ac25d4a0324/absl_py-1.0.0-py3-none-any.whl (126 kB) |████████████████████████████████| 126 kB 11.2 MB/s Requirement already satisfied: typing-extensions>=3.6.6 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (3.10.0.2) Collecting astunparse>=1.6.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2b/03/13dde6512ad7b4557eb792fbcf0c653af6076b81e5941d36ec61f7ce6028/astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting flatbuffers<3.0,>=1.12 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3d/d0/26033c70d642fbc1e35d3619cf3210986fb953c173b1226709f75056c149/flatbuffers-2.0-py2.py3-none-any.whl (26 kB) Collecting gast<0.5.0,>=0.2.1 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b6/48/583c032b79ae5b3daa02225a675aeb673e58d2cb698e78510feceb11958c/gast-0.4.0-py3-none-any.whl (9.8 kB) Requirement already satisfied: h5py>=2.9.0 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (3.3.0) Requirement already satisfied: six>=1.12.0 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (1.16.0) Requirement already satisfied: grpcio<2.0,>=1.24.3 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (1.42.0) Collecting tensorflow-estimator<2.8,~=2.7.0rc0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/db/de/3a71ad41b87f9dd424e3aec3b0794a60f169fa7e9a9a1e3dd44290b86dd6/tensorflow_estimator-2.7.0-py2.py3-none-any.whl (463 kB) |████████████████████████████████| 463 kB 10.4 MB/s Requirement already satisfied: protobuf>=3.9.2 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (3.19.1) Collecting google-pasta>=0.1.1 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57 kB) |████████████████████████████████| 57 kB 3.2 MB/s Requirement already satisfied: termcolor>=1.1.0 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (1.1.0) Collecting keras<2.8,>=2.7.0rc0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6b/8b/065f94ba03282fa41b2d76942b87a180a9913312c4611ea7d6508fbbc114/keras-2.7.0-py2.py3-none-any.whl (1.3 MB) |████████████████████████████████| 1.3 MB 10.6 MB/s Requirement already satisfied: numpy>=1.14.5 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (1.20.3) Collecting tensorboard~=2.6 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2d/eb/80f75ab480cfbd032442f06ec7c15ef88376c5ef7fd6f6bf2e0e03b47e31/tensorboard-2.7.0-py3-none-any.whl (5.8 MB) |████████████████████████████████| 5.8 MB 11.8 MB/s Collecting tensorflow-io-gcs-filesystem>=0.21.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f8/14/6cd0e69ce9d4018650f3d1c62fd8b1bbf2dd4edb6df7866eb76457f49851/tensorflow_io_gcs_filesystem-0.22.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.1 MB) |████████████████████████████████| 2.1 MB 11.1 MB/s Requirement already satisfied: wrapt>=1.11.0 in ./anaconda3/lib/python3.9/site-packages (from tensorflow) (1.12.1) Collecting opt-einsum>=2.3.2 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB) |████████████████████████████████| 65 kB 3.3 MB/s Collecting keras-preprocessing>=1.1.1 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/79/4c/7c3275a01e12ef9368a892926ab932b33bb13d55794881e3573482b378a7/Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB) |████████████████████████████████| 42 kB 1.3 MB/s Collecting google-auth<3,>=1.6.3 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6a/f7/06cbd5ebfba40a9d51df6217f9325317d824234400454aebcf014e2eee38/google_auth-2.3.3-py2.py3-none-any.whl (155 kB) |████████████████████████████████| 155 kB 10.7 MB/s Collecting markdown>=2.6.8 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9f/d4/2c7f83915d437736996b2674300c6c4b578a6f897f34e40f5c04db146719/Markdown-3.3.6-py3-none-any.whl (97 kB) |████████████████████████████████| 97 kB 5.2 MB/s Collecting tensorboard-data-server<0.7.0,>=0.6.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/60/f9/802efd84988bffd9f644c03b6e66fde8e76c3aa33db4279ddd11c5d61f4b/tensorboard_data_server-0.6.1-py3-none-manylinux2010_x86_64.whl (4.9 MB) |████████████████████████████████| 4.9 MB 12.7 MB/s Collecting google-auth-oauthlib<0.5,>=0.4.1 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b1/0e/0636cc1448a7abc444fb1b3a63655e294e0d2d49092dc3de05241be6d43c/google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB) Requirement already satisfied: werkzeug>=0.11.15 in ./anaconda3/lib/python3.9/site-packages (from tensorboard~=2.6->tensorflow) (2.0.2) Requirement already satisfied: setuptools>=41.0.0 in ./anaconda3/lib/python3.9/site-packages (from tensorboard~=2.6->tensorflow) (58.0.4) Requirement already satisfied: requests<3,>=2.21.0 in ./anaconda3/lib/python3.9/site-packages (from tensorboard~=2.6->tensorflow) (2.26.0) Collecting tensorboard-plugin-wit>=1.6.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1a/c1/499e600ba0c618b451cd9c425ae1c177249940a2086316552fee7d86c954/tensorboard_plugin_wit-1.8.0-py3-none-any.whl (781 kB) |████████████████████████████████| 781 kB 11.5 MB/s Collecting rsa<5,>=3.1.4 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/30/ab/8fd9e88e6fa5ec41afca995938bbefb72195278e0cfc5bd76a4f29b23fb2/rsa-4.8-py3-none-any.whl (39 kB) Collecting pyasn1-modules>=0.2.1 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB) |████████████████████████████████| 155 kB 10.2 MB/s Collecting cachetools<5.0,>=2.0.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ea/c1/4740af52db75e6dbdd57fc7e9478439815bbac549c1c05881be27d19a17d/cachetools-4.2.4-py3-none-any.whl (10 kB) Collecting requests-oauthlib>=0.7.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl (23 kB) Requirement already satisfied: importlib-metadata>=4.4 in ./anaconda3/lib/python3.9/site-packages (from markdown>=2.6.8->tensorboard~=2.6->tensorflow) (4.8.1) Requirement already satisfied: zipp>=0.5 in ./anaconda3/lib/python3.9/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard~=2.6->tensorflow) (3.6.0) Collecting pyasn1<0.5.0,>=0.4.6 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl (77 kB) |████████████████████████████████| 77 kB 2.2 MB/s Requirement already satisfied: charset-normalizer~=2.0.0 in ./anaconda3/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (2.0.4) Requirement already satisfied: certifi>=2017.4.17 in ./anaconda3/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (2021.10.8) Requirement already satisfied: idna<4,>=2.5 in ./anaconda3/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (3.2) Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./anaconda3/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (1.26.7) Collecting oauthlib>=3.0.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e8/5d/9dd1c29e5a786525f6342f6c1d812ed2e37edc653ad297048c1668988053/oauthlib-3.1.1-py2.py3-none-any.whl (146 kB) |████████████████████████████████| 146 kB 9.0 MB/s Installing collected packages: pyasn1, rsa, pyasn1-modules, oauthlib, cachetools, requests-oauthlib, google-auth, tensorboard-plugin-wit, tensorboard-data-server, markdown, google-auth-oauthlib, absl-py, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard, opt-einsum, libclang, keras-preprocessing, keras, google-pasta, gast, flatbuffers, astunparse, tensorflow Successfully installed absl-py-1.0.0 astunparse-1.6.3 cachetools-4.2.4 flatbuffers-2.0 gast-0.4.0 google-auth-2.3.3 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 keras-2.7.0 keras-preprocessing-1.1.2 libclang-12.0.0 markdown-3.3.6 oauthlib-3.1.1 opt-einsum-3.3.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-oauthlib-1.3.0 rsa-4.8 tensorboard-2.7.0 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.0 tensorflow-2.7.0 tensorflow-estimator-2.7.0 tensorflow-io-gcs-filesystem-0.22.0
果然还是清华的源更香些啊。