pip安装TensorFlow-GPU时报错,该如何解决?

各位大佬,本人在pycharm中安装TensorFlow的GPU版时出现这种错误,该如何解决呢?CUDA和cudnn已经安装好了。

PS D:\lrw> pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -- tensorflow-gpu
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting tensorflow-gpu
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4c/12/888d61c5f8d5f2d7c0c96869945b92f341c25f3a3297239c34672d8a8df9/tensorflow_gpu-2.9.1-cp310-cp310-win_amd64.whl (444.1 MB)
Collecting keras-preprocessing>=1.1.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/79/4c/7c3275a01e12ef9368a892926ab932b33bb13d55794881e3573482b378a7/Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
Requirement already satisfied: setuptools in f:\python\lib\site-packages (from tensorflow-gpu) (63.1.0)
Collecting h5py>=2.9.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bd/18/f5eed64fc06b9d17ef11647d6c5016b8a97e3abf0afe6d080c070027a195/h5py-3.7.0-cp310-cp310-win_amd64.whl (2.6 MB)
Collecting wrapt>=1.11.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c0/1e/e5a5ac09e92fd112d50e1793e5b9982dc9e510311ed89dacd2e801f82967/wrapt-1.14.1-cp310-cp310-win_amd64.whl (35 kB)
Collecting gast<=0.4.0,>=0.2.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b6/48/583c032b79ae5b3daa02225a675aeb673e58d2cb698e78510feceb11958c/gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting flatbuffers<2,>=1.12
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/eb/26/712e578c5f14e26ae3314c39a1bdc4eb2ec2f4ddc89b708cf8e0a0d20423/flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: numpy>=1.20 in f:\python\lib\site-packages (from tensorflow-gpu) (1.23.1)
Collecting termcolor>=1.1.0
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz (3.9 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "", line 2, in
        File "", line 34, in
        File "C:\Users\NBU\AppData\Local\Temp\pip-install-76b_4xf1\termcolor_53698160e09b4c04948ab8aa3dfbaf3b\setup.py", line 37, in
          setup(name='termcolor',
        File "F:\Python\lib\site-packages\setuptools\_distutils\core.py", line 139, in setup
          _setup_distribution = dist = klass(attrs)
        File "F:\Python\lib\site-packages\setuptools\dist.py", line 476, in __init__
          _Distribution.__init__(
        File "F:\Python\lib\site-packages\setuptools\_distutils\dist.py", line 275, in __init__
          self.finalize_options()
        File "F:\Python\lib\site-packages\setuptools\dist.py", line 899, in finalize_options
          for ep in sorted(loaded, key=by_order):
        File "F:\Python\lib\site-packages\setuptools\dist.py", line 898, in
          loaded = map(lambda e: e.load(), filtered)
        File "F:\Python\lib\importlib\metadata\__init__.py", line 173, in load
          return functools.reduce(getattr, attrs, module)
      AttributeError: type object 'Distribution' has no attribute '_finalize_feature_opts'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
 

你可能感兴趣的:(tensorflow,pip,python)