鱼C论坛

 找回密码
 立即注册
查看: 2131|回复: 6

[已解决]pip install tensorflow一直报错

[复制链接]
发表于 2022-7-14 16:49:43 | 显示全部楼层 |阅读模式
60鱼币
新人,不知道怎么描述,算是插件吧,目前看需要用软件自带的python,现在在给这个python配置tensorflow,但是一直报错。报错显示如下:

D:\BIMBase\BIMBase Parametric\PythonScript\python-3.7.9-embed-amd64>pip install tensorflow
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting tensorflow
  Using cached https://mirrors.bfsu.edu.cn/pypi ... cp37m-win_amd64.whl (444.0 MB)
Collecting flatbuffers<2,>=1.12
  Using cached https://mirrors.bfsu.edu.cn/pypi ... y2.py3-none-any.whl (15 kB)
Collecting google-pasta>=0.1.1
  Using cached https://mirrors.bfsu.edu.cn/pypi ... .0-py3-none-any.whl (57 kB)
Requirement already satisfied: absl-py>=1.0.0 in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: tensorboard<2.10,>=2.9 in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (2.9.1)
Requirement already satisfied: grpcio<2.0,>=1.24.3 in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (1.47.0)
Requirement already satisfied: six>=1.12.0 in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (1.16.0)
Collecting gast<=0.4.0,>=0.2.1
  Using cached https://mirrors.bfsu.edu.cn/pypi ... .0-py3-none-any.whl (9.8 kB)
Collecting tensorflow-io-gcs-filesystem>=0.23.1
  Using cached https://mirrors.bfsu.edu.cn/pypi ... cp37m-win_amd64.whl (1.5 MB)
Collecting astunparse>=1.6.0
  Using cached https://mirrors.bfsu.edu.cn/pypi ... y2.py3-none-any.whl (12 kB)
Collecting keras<2.10.0,>=2.9.0rc0
  Using cached https://mirrors.bfsu.edu.cn/pypi ... y2.py3-none-any.whl (1.6 MB)
Requirement already satisfied: typing-extensions>=3.6.6 in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (4.3.0)
Requirement already satisfied: numpy>=1.20 in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (1.21.6)
Collecting wrapt>=1.11.0
  Using cached https://mirrors.bfsu.edu.cn/pypi ... cp37m-win_amd64.whl (35 kB)
Collecting tensorflow-estimator<2.10.0,>=2.9.0rc0
  Using cached https://mirrors.bfsu.edu.cn/pypi ... y2.py3-none-any.whl (438 kB)
Collecting h5py>=2.9.0
  Using cached https://mirrors.bfsu.edu.cn/pypi ... cp37m-win_amd64.whl (2.6 MB)
Requirement already satisfied: setuptools in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (63.1.0)
Collecting opt-einsum>=2.3.2
  Using cached https://mirrors.bfsu.edu.cn/pypi ... .0-py3-none-any.whl (65 kB)
Requirement already satisfied: packaging in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (21.3)
Requirement already satisfied: protobuf<3.20,>=3.9.2 in d:\bimbase\bimbase parametric\pythonscript\python-3.7.9-embed-amd64\lib\site-packages (from tensorflow) (3.19.4)
Collecting keras-preprocessing>=1.1.1
  Using cached https://mirrors.bfsu.edu.cn/pypi ... y2.py3-none-any.whl (42 kB)
Collecting termcolor>=1.1.0
  Using cached https://mirrors.bfsu.edu.cn/pypi ... mcolor-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
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\shin\AppData\Local\Temp\pip-install-45xikr6k\termcolor_25b1cb8fa14a45a3b26af510f015cf75\setup.py", line 35, in <module>
          from termcolor import VERSION
      ModuleNotFoundError: 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没安装,但是pip install termcolor同样报错

Preparing metadata (setup.py) ... error
  error: 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>
        File "C:\Users\shin\AppData\Local\Temp\pip-install-eh_h7seb\termcolor_d1810da4ff784ebca5d302d1162fffa6\setup.py", line 35, in <module>
          from termcolor import VERSION
      ModuleNotFoundError: 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.
最佳答案
2022-7-14 16:49:44
破伤风的土豆 发表于 2022-7-18 23:55
我把termcolor卸载后重新安装也是报错这个no module named termcolor,然后我从网上下了一个termcolor-wh ...

https://files.pythonhosted.org/p ... y2.py3-none-any.whl

最佳答案

查看完整内容

https://files.pythonhosted.org/packages/2b/ad/9e826b1bd69dc3faa5abb7b6459528e16831c0e73b353479a467ed5ee995/termcolor_whl-1.1.2-py2.py3-none-any.whl
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2022-7-14 16:49:44 | 显示全部楼层    本楼为最佳答案   
破伤风的土豆 发表于 2022-7-18 23:55
我把termcolor卸载后重新安装也是报错这个no module named termcolor,然后我从网上下了一个termcolor-wh ...

https://files.pythonhosted.org/p ... y2.py3-none-any.whl
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2022-7-15 00:18:00 | 显示全部楼层
你这装的是conda版还是不是conda版本阿
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2022-7-15 18:06:50 | 显示全部楼层
同类型问题(但不知道处理方式能否通用)
安装路径中应该有两个pip文件,都删掉,然后用pycharm重新安装pip
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2022-7-16 01:15:33 | 显示全部楼层
本帖最后由 jackz007 于 2022-7-16 01:16 编辑

        看上去,问题确实出在 termcolor 模块没能正确安装上,可是,在我这里是可以正常安装的。
D:\[00.Exerciese.2022]\C>pip install termcolor
Collecting termcolor
  Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10ea4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Installing collected packages: termcolor
  Running setup.py install for termcolor
Successfully installed termcolor-1.1.0
You are using pip version 7.1.2, however version 22.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' com
and.

D:\[00.Exerciese.2022]\C>
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2022-7-18 23:46:44 | 显示全部楼层
Victor0321 发表于 2022-7-15 00:18
你这装的是conda版还是不是conda版本阿

我电脑之前先用anaconda装过一次,用的conda install,用的pycharm编译,后来比赛方给的要求用vscode编译,而且需要的是用他们给安装包里的python(这个才能和他们的软件联动),然后我用这个进行pip安装时就出现了报错,是因为之前用conda安过一次吗
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2022-7-18 23:55:31 | 显示全部楼层
jackz007 发表于 2022-7-16 01:15
看上去,问题确实出在 termcolor 模块没能正确安装上,可是,在我这里是可以正常安装的。

我把termcolor卸载后重新安装也是报错这个no module named termcolor,然后我从网上下了一个termcolor-whl,安装后显示安装成功,但是show的时候显示没有这个。接着安装tensorflow时不在报错前面那个了,改为了cannot import name 'VERSION' from 'termcolor'。是我安装的termcolor有问题吗?你有没有离线包,能发我一下吗?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-17 14:41

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表