Linux环境中安装Anaconda、Pytorch、Opencv、Tensorflow等工具的方法

1 安装Anaconda

1)从官网下载Anaconda

2)bash 下载路径+文件名.sh

3)在安装的过程中,Anaconda的bin目录一般会加入到~/.bashrc文件中(PATH,环境变量),所以需要激活  source ~/.bashrc

2 安装Pytorch

https://blog.csdn.net/nyist_yangguang/article/details/109825256  

3 安装Opencv等文件

conda config --remove-key channels   //删除所有源以后,就是恢复默认源

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/   //添加源

conda config --set show_channel_urls yes   //下载包的时候,显示使用的哪个源下载的

 

conda install -c menpo opencv3   //连接不上可以看 https://www.zhihu.com/question/40431966

 

pip install sip -i https://pypi.douban.com/simple

pip install PyQt5 -i https://pypi.douban.com/simple

pip install PyQt5-tools -i https://pypi.douban.com/simple

pip install openCV-python -i https://pypi.douban.com/simple

 

4 安装Tensorflow

尝试了多次:

尝试1:

(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Desktop$ pip install --ignore-installed --upgrade https://files.pythonhosted.org/packages/3a/ff/ed0a9ddf92919d2051e2e6d1fc43320543e667958db7717907bb94dc42a5/tensorflow-2.3.1-cp38-cp38-manylinux2010_x86_64.whl
Collecting tensorflow==2.3.1
  Downloading tensorflow-2.3.1-cp38-cp38-manylinux2010_x86_64.whl (320.5 MB)
     |███                             | 29.1 MB 6.6 kB/s eta 12:18:10ERROR: Exception:
Traceback (most recent call last):
  File "/home/wangbin/anaconda3/lib/python3.8/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 313, in recv_into ...

尝试2:

(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ conda install tensorflow_gpu-2.3.0-cp38-cp38-manylinux2010_x86_64.whl
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow_gpu-2.3.0-cp38-cp38-manylinux2010_x86_64.whl

Current channels:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/linux-64
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

尝试3:

先下载下来tensorflow的安装包 *.whl

(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ pkgs -i tensorflow_gpu-2.3.0-cp38-cp38-manylinux2010_x86_64.whl
bash: pkgs: command not found
尝试4:

先下载下来tensorflow的安装包 *.whl

(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ conda pkgs -i tensorflow_gpu-2.3.0-cp38-cp38-manylinux2010_x86_64.whl

CommandNotFoundError: No command 'conda pkgs'.
 

尝试5:

先下载下来tensorflow的安装包 *.whl

(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ pip install tensorflow_gpu-2.3.0-cp38-cp38-manylinux2010_x86_64.whl
Processing ./tensorflow_gpu-2.3.0-cp38-cp38-manylinux2010_x86_64.whl
Collecting termcolor>=1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Collecting six>=1.12.0
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
ERROR: Could not find a version that satisfies the requirement h5py<2.11.0,>=2.10.0 (from tensorflow-gpu==2.3.0) (from versions: none)
ERROR: No matching distribution found for h5py<2.11.0,>=2.10.0 (from tensorflow-gpu==2.3.0)
 

尝试6:

(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ pip install tensorflow==2.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting tensorflow==2.3.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/45/6e/d916ae0b2b8319caf55860de6a173aaabfe2350334c25a064ce0cc8c6852/tensorflow-2.3.0-cp38-cp38-manylinux2010_x86_64.whl (320.5 MB)
     |████████████████████████████████| 320.5 MB 5.7 kB/s 
Collecting six>=1.12.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: wheel>=0.26 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.3.0) (0.35.1)
Collecting keras-preprocessing<1.2,>=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 656 kB/s 
Collecting absl-py>=0.7.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bc/58/0aa6fb779dc69cfc811df3398fcbeaeefbf18561b6e36b185df0782781cc/absl_py-0.11.0-py3-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 30.9 MB/s 
Collecting tensorboard<3,>=2.3.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/02/83/179c8f76e5716030cc3ee9433721161cfcc1d854e9ba20c9205180bb100a/tensorboard-2.4.0-py3-none-any.whl (10.6 MB)
     |████████████████████████████████| 10.6 MB 1.0 MB/s 
Collecting google-pasta>=0.1.8
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 5.2 MB/s 
Collecting numpy<1.19.0,>=1.16.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/01/c6/87592f924246da1e58673cf708a2748754517c5cf050726238d6cfbd8df4/numpy-1.18.5-cp38-cp38-manylinux1_x86_64.whl (20.6 MB)
     |████████████████████████████████| 20.6 MB 112 kB/s 
Collecting astunparse==1.6.3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2b/03/13dde6512ad7b4557eb792fbcf0c653af6076b81e5941d36ec61f7ce6028/astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting gast==0.3.3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d6/84/759f5dd23fec8ba71952d97bcc7e2c9d7d63bdc582421f3cd4be845f0c98/gast-0.3.3-py2.py3-none-any.whl (9.7 kB)
Processing /home/wangbin/.cache/pip/wheels/e3/de/40/cc69e66c496ef6bfe23010d31ca5584a6d58ab4cf2f5b5a187/termcolor-1.1.0-py3-none-any.whl
Collecting scipy==1.4.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f3/08/8bdcdcd149ea41b655956feb7c19ebf7e1f561738bd5570b6ae015daf411/scipy-1.4.1-cp38-cp38-manylinux1_x86_64.whl (26.0 MB)
     |████████████████████████████████| 26.0 MB 148 kB/s 
Collecting grpcio>=1.8.6
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/88/90/9729e1b0642c33b5fb8a60d09035b486a53cf06b3e412d2e8c1c19aeadbb/grpcio-1.33.2-cp38-cp38-manylinux2014_x86_64.whl (3.8 MB)
     |████████████████████████████████| 3.8 MB 29.8 MB/s 
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 h5py<2.11.0,>=2.10.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9d/4f/46dbeea4aee767e15725950b6aac2c56c4eff9e5044886aa7ef932319476/h5py-2.10.0-cp38-cp38-manylinux1_x86_64.whl (2.9 MB)
     |████████████████████████████████| 2.9 MB 14 kB/s 
Processing /home/wangbin/.cache/pip/wheels/9b/c8/62/9d6aad874ab4f2600bf95167be834ab8abfdb1d73e3051c8c6/wrapt-1.12.1-cp38-cp38-linux_x86_64.whl
Collecting protobuf>=3.9.2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3e/b2/e4099c78e483e7a612d67eeb0c8740ce15cdeba4a0032da121c791f7d352/protobuf-3.14.0-cp38-cp38-manylinux1_x86_64.whl (1.0 MB)
     |████████████████████████████████| 1.0 MB 15 kB/s 
Collecting tensorflow-estimator<2.4.0,>=2.3.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e9/ed/5853ec0ae380cba4588eab1524e18ece1583b65f7ae0e97321f5ff9dfd60/tensorflow_estimator-2.3.0-py2.py3-none-any.whl (459 kB)
     |████████████████████████████████| 459 kB 197 kB/s 
Collecting werkzeug>=0.11.15
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cc/9(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ python4/5f7079a0e00bd6863ef8f1da638721e9da21e5bacee597595b318f71d62e/Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
     |████████████████████████████████| 298 kB 13.5 MB/s 
Collecting markdown>=2.6.8
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ac/ef/24a91ca96efa0d7802dffb83ccc7a3c677027bea19ec3c9ee80be740408e/Markdown-3.3.3-py3-none-any.whl (96 kB)
     |████████████████████████████████| 96 kB 813 kB/s 
Requirement already satisfied: setuptools>=41.0.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<3,>=2.3.0->tensorflow==2.3.0) (50.3.1.post20201107)
Collecting requests<3,>=2.21.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/39/fc/f91eac5a39a65f75a7adb58eac7fa78871ea9872283fb9c44e6545998134/requests-2.25.0-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 41 kB/s 
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/81/67/e2c34bb0628984c7ce71cce6ba6964cb29c418873847fc285f826e032e6e/google_auth_oauthlib-0.4.2-py2.py3-none-any.whl (18 kB)
Collecting google-auth<2,>=1.6.3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1d/60/81e68e70eea91ef05bb00bcdac243d67b61f826c65aaca6961de622dffd7/google_auth-1.23.0-py2.py3-none-any.whl (114 kB)
     |████████████████████████████████| 114 kB 92 kB/s 
Collecting tensorboard-plugin-wit>=1.6.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b6/85/5c5ac0a8c5efdfab916e9c6bc18963f6a6996a8a1e19ec4ad8c9ac9c623c/tensorboard_plugin_wit-1.7.0-py3-none-any.whl (779 kB)
     |████████████████████████████████| 779 kB 182 kB/s 
Collecting idna<3,>=2.5
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 78 kB/s 
Requirement already satisfied: certifi>=2017.4.17 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow==2.3.0) (2020.6.20)
Collecting urllib3<1.27,>=1.21.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f5/71/45d36a8df68f3ebb098d6861b2c017f3d094538c0fb98fa61d4dc43e69b9/urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
     |████████████████████████████████| 136 kB 317 kB/s 
Collecting chardet<4,>=3.0.2
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133 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)
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 318 kB/s 
Collecting cachetools<5.0,>=2.0.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cd/5c/f3aa86b6d5482f3051b433c7616668a9b96fbe49a622210e2c9781938a5c/cachetools-4.1.1-py3-none-any.whl (10 kB)
Collecting rsa<5,>=3.1.4; python_version >= "3.5"
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1c/df/c3587a667d6b308fadc90b99e8bc8774788d033efcc70f4ecaae7fad144b/rsa-4.6-py3-none-any.whl (47 kB)
     |████████████████████████████████| 47 kB 147 kB/s 
Collecting oauthlib>=3.0.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 243 kB/s 
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 163 kB/s 
Installing collected packages: six, numpy, keras-preprocessing, absl-py, grpcio, werkzeug, markdown, idna, urllib3, chardet, requests, oauthlib, requests-oauthlib, pyasn1, pyasn1-modules, cachetools, rsa, google-auth, google-auth-oauthlib, protobuf, tensorboard-plugin-wit, tensorboard, google-pasta, astunparse, gast, termcolor, scipy, opt-einsum, h5py, wrapt, tensorflow-estimator, tensorflow
Successfully installed absl-py-0.11.0 astunparse-1.6.3 cachetools-4.1.1 chardet-3.0.4 gast-0.3.3 google-auth-1.23.0 google-auth-oauthlib-0.4.2 google-pasta-0.2.0 grpcio-1.33.2 h5py-2.10.0 idna-2.10 keras-preprocessing-1.1.2 markdown-3.3.3 numpy-1.18.5 oauthlib-3.1.0 opt-einsum-3.3.0 protobuf-3.14.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.25.0 requests-oauthlib-1.3.0 rsa-4.6 scipy-1.4.1 six-1.15.0 tensorboard-2.4.0 tensorboard-plugin-wit-1.7.0 tensorflow-2.3.0 tensorflow-estimator-2.3.0 termcolor-1.1.0 urllib3-1.26.2 werkzeug-1.0.1 wrapt-1.12.1
(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ python
Python 3.8.5 (default, Sep  4 2020, 07:30:14) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2020-11-20 20:51:24.113468: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-11.1/lib64
2020-11-20 20:51:24.113490: 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.

根据报错信息 :Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory ...

查看链接:https://github.com/tensorflow/tensorflow/issues/38578

人家说版本不对,2.2的tensorflow要好一些(回答:Using Cuda 10.1 with TensorFlow 2.2 solves the issue.)

 

尝试7:

(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ pip install tensorflow==2.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting tensorflow==2.2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5e/5e/8812d6e4f61a1ba2b11c125a6bae985dbe24aa738f2247f817e0d2a5f90a/tensorflow-2.2.0-cp38-cp38-manylinux2010_x86_64.whl (516.3 MB)
     |████████████████████████████████| 516.3 MB 16 kB/s 
Requirement already satisfied: termcolor>=1.1.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.1.0)
Requirement already satisfied: keras-preprocessing>=1.1.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.1.2)
Requirement already satisfied: astunparse==1.6.3 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.6.3)
Requirement already satisfied: absl-py>=0.7.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (0.11.0)
Requirement already satisfied: grpcio>=1.8.6 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.33.2)
Requirement already satisfied: gast==0.3.3 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (0.3.3)
Requirement already satisfied: six>=1.12.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.15.0)
Collecting tensorboard<2.3.0,>=2.2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1d/74/0a6fcb206dcc72a6da9a62dd81784bfdbff5fedb099982861dc2219014fb/tensorboard-2.2.2-py3-none-any.whl (3.0 MB)
     |████████████████████████████████| 3.0 MB 10.5 MB/s 
Requirement already satisfied: wrapt>=1.11.1 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.12.1)
Requirement already satisfied: h5py<2.11.0,>=2.10.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (2.10.0)
Collecting tensorflow-estimator<2.3.0,>=2.2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a4/f5/926ae53d6a226ec0fda5208e0e581cffed895ccc89e36ba76a8e60895b78/tensorflow_estimator-2.2.0-py2.py3-none-any.whl (454 kB)
     |████████████████████████████████| 454 kB 35.7 MB/s 
Requirement already satisfied: scipy==1.4.1; python_version >= "3" in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.4.1)
Requirement already satisfied: opt-einsum>=2.3.2 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (3.3.0)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (0.35.1)
Requirement already satisfied: numpy<2.0,>=1.16.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (1.18.5)
Requirement already satisfied: google-pasta>=0.1.8 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (0.2.0)
Requirement already satisfied: protobuf>=3.8.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorflow==2.2.0) (3.14.0)
Requirement already satisfied: setuptools>=41.0.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (50.3.1.post20201107)
Requirement already satisfied: google-auth<2,>=1.6.3 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.23.0)
Requirement already satisfied: requests<3,>=2.21.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (2.25.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.4.2)
Requirement already satisfied: markdown>=2.6.8 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.3.3)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.7.0)
Requirement already satisfied: werkzeug>=0.11.15 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.0.1)
Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3.5" in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (4.6)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.2.8)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (4.1.1)
Requirement already satisfied: idna<3,>=2.5 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.26.2)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (1.3.0)
Requirement already satisfied: pyasn1>=0.1.3 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from rsa<5,>=3.1.4; python_version >= "3.5"->google-auth<2,>=1.6.3->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in /home/wangbin/anaconda3/envs/py3_tf/lib/python3.8/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.3.0,>=2.2.0->tensorflow==2.2.0) (3.1.0)
Installing collected packages: tensorboard, tensorflow-estimator, tensorflow
  Attempting uninstall: tensorboard
    Found existing installation: tensorboard 2.4.0
    Uninstalling tensorboard-2.4.0:
      Successfully uninstalled tensorboard-2.4.0
  Attempting uninstall: tensorflow-estimator
    Found existing installation: tensorflow-estimator 2.3.0
    Uninstalling tensorflow-estimator-2.3.0:
      Successfully uninstalled tensorflow-estimator-2.3.0
  Attempting uninstall: tensorflow
    Found existing installation: tensorflow 2.3.0
    Uninstalling tensorflow-2.3.0:
      Successfully uninstalled tensorflow-2.3.0
Successfully installed tensorboard-2.2.2 tensorflow-2.2.0 tensorflow-estimator-2.2.0
(py3_tf) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Downloads$ python
Python 3.8.5 (default, Sep  4 2020, 07:30:14) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf 
>>> hello = tf.constant("Hello World, TensorFlow!")
2020-11-20 21:02:20.400085: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-11-20 21:02:20.436194: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-11-20 21:02:20.436602: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: 
pciBusID: 0000:01:00.0 name: GeForce RTX 3080 computeCapability: 8.6
coreClock: 1.71GHz coreCount: 68 deviceMemorySize: 9.78GiB deviceMemoryBandwidth: 707.88GiB/s
2020-11-20 21:02:20.436696: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-11.1/lib64
2020-11-20 21:02:20.436746: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10'; dlerror: libcublas.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-11.1/lib64
2020-11-20 21:02:20.451140: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-11-20 21:02:20.453788: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-11-20 21:02:20.454042: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.10'; dlerror: libcusolver.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-11.1/lib64
2020-11-20 21:02:20.454242: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusparse.so.10'; dlerror: libcusparse.so.10: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-11.1/lib64
2020-11-20 21:02:20.454431: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudnn.so.7'; dlerror: libcudnn.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-11.1/lib64
2020-11-20 21:02:20.454464: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1598] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2020-11-20 21:02:20.455084: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-11-20 21:02:20.471704: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 3799900000 Hz
2020-11-20 21:02:20.472732: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f95d8000b60 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-11-20 21:02:20.472773: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
2020-11-20 21:02:20.475378: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-11-20 21:02:20.475405: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108]      

终于安装成功! 

安装成功的标志是  在python中 输入 import tensorflow as tf 以后不报错,没输出信息。
 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序猿的探索之路

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值