【发布时间】:2022-07-14 03:42:26
【问题描述】:
我正在尝试使用 pip install tensorflow 安装 tensorflow。我可以安装其他软件包,但 tensorflow 无法正常工作。这是我得到的错误:
C:\Users\sebas>python -m pip install tensorflow
Collecting tensorflowUsing cached tensorflow-2.8.0-cp37-cp37m-win_amd64.whl (437.9 MB)Collecting h5py>=2.9.0Using cached h5py-3.6.0-cp37-cp37m-win_amd64.whl (2.8 MB)Collecting tensorboard<2.9,>=2.8Using cached tensorboard-2.8.0-py3-none-any.whl (5.8 MB)Collecting termcolor>=1.1.0Using cached termcolor-1.1.0.tar.gz (3.9 kB)Preparing metadata (setup.py) ... errorerror: subprocess-exited-with-error× python setup.py egg_info did not run successfully.│ exit code: 1╰─> [6 lines of output]Traceback (most recent call last):File "<string", line 36, in <module>File "pip-setuptools-caller>", line 34, in <module>
@ 987654339@from termcolor import VERSIONModuleNotFoundError: No module named 'termcolor'[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.\
【问题讨论】:
-
您是否尝试先安装
termcolor?也许它会显示更多信息。 -
是的,当我尝试安装 tensorflow 时,它给了我同样的错误。
-
所以主要问题是
termcolor,您需要找出它无法安装的原因。pip具有选项--verbose,当您安装termcolor时可能会显示更多信息。也许它需要一些你必须单独安装的 C/C++ 库(而不是pip)。 -
我检查了包
termcolor中的文件setup.py,看起来它在安装之前尝试加载termcolor 以获取VERSION。旧版本 0.2 不这样做。也许首先安装旧版本pip install termcolor==0.2,然后更新到新版本pip install -U termcolor -
你也可以从Unofficial Windows Binaries for Python Extension Packages下载
termcolor作为文件.whl并尝试安装pip install termcolor‑1.1.0‑py2.py3‑none‑any.whl
标签: python tensorflow termcolor