开源改变世界!!

pip 安装失败 #1468

推推 grbl 2年前 (2023-02-02) 222次浏览
关闭
kaipyroami 打开了这个问题 2020 年 9 月 30 日 · 6 条评论 · 由#1488修复
关闭

pip 安装失败#1468

kaipyroami 打开了这个问题 2020 年 9 月 30 日 · 6 条评论 · 由#1488修复

评论

pip 安装失败 #1468

使用首选 pip 安装方法失败。我想我安装了所有依赖项,但可能缺少一个。

pip2 install --upgrade bCNC

  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpOYEQQe
       cwd: /tmp/pip-install-lm66Io/opencv-python
  Complete output (22 lines):
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 146, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 127, in _get_build_requires
      self.run_setup()
    File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 243, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/usr/local/lib/python2.7/dist-packages/setuptools/build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 448, in <module>
      main()
    File "setup.py", line 99, in main
      % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))}
    File "/usr/lib/python2.7/re.py", line 210, in escape
      s = list(pattern)
  TypeError: 'NoneType' object is not iterable
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python /usr/local/lib/python2.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpOYEQQe Check the logs for full command output.```
pip 安装失败 #1468
悬崖彭纳利根 评论了 2020 年 9 月 30 日  

我不这么认为。我遇到了同样的问题。昨天,在 Win10 上我安装了 Python 2.7,所有选项包括设置 PATH。然后我执行了上面的命令。我第一次收到上面的消息。当我第二次执行它时,它使用了缓存数据,这表明它正在尝试安装不支持 Python 2.7 的 opencv-python-4.3.0.38。一旦我弄清楚,我会发布一个解决方法。下面的第二个错误消息:

system32>pip2 install –upgrade bcnc
弃用:Python 2.7 将于 2020 年 1 月 1 日结束。请升级您的 Python,因为 Python 2.7 将在该日期之后停止维护。pip 的未来版本将放弃对 Python 2.7 的支持。有关 pip 中 Python 2 支持的更多详细信息,请访问https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting bcnc
Using cached https://files.pythonhosted .org/packages/e9/de/66813ff9559b4013bc271a862f78a91d31044b6f7ddbb2022fb1716f538c/bCNC-0.9.14.307.tar.gz
Collecting numpy>=1.12 (from bcnc)
Using cached https://files.pythonhosted.org/packages/14/ef/9f2eeb4ff0c733ad9149f17266e388c308e171fdb8c2415dbb472e2bbc0f/numpy -1.16.6-cp27-cp27m-win_amd64.whl
收集 Pillow> = 4.0(来自 bcnc)
使用缓存https://files.pythonhosted.org/packages/5e/b6/8960697526a79bd1cb4520293078be3a10d725f23f20abbee298ebdeaabd/Pillow-6.2.2-cp27-cp27m-win_amd=64.whlial1<0.whlial1
来自 bcnc)
使用缓存的https://files.pythonhosted.org/packages/42/68/41bab8a5e3e50705f25358f043181242fa197f313aa0476908d9852c8dc4/pyserial-3.0.1.tar.gz
收集 opencv-python>=2.4(来自
缓存的https://files )使用.pythonhosted.org/packages/a1/d6/8422797e35f8814b1d9842530566a949d9b5850a466321a6c1d5a99055ee/opencv-python-4.3.0.38.tar.gz
安装构建依赖项…完成
获取构建轮的要求…错误
错误:命令出错:退出状态为 1
命令:’C:\Python27\python.exe’ ‘C:\Python27\lib\site-packages\pip_vendor\pep517_in_process.py’ get_requires_for_build_wheel ‘c:\users\owner\appdata\local\temp\tmpvx6k6w’
cwd: c :\users\owner\appdata\local\temp\pip-install-3spfhd\opencv-python
完整输出(22 行):
Traceback(最后一次调用):
文件“C:\Python27\lib\site-packages\pip_vendor \pep517_in_process.py”,第 207 行,在
main()
文件“C:\Python27\lib\site-packages\pip_vendor\pep517_in_process.py”,第 197 行,在 main
json_out[‘return_val’] = hook(**hook_input [‘kwargs’])
文件“C:\Python27\lib\site-packages\pip_vendor\pep517_in_process.py”,第 54 行,在 get_requires_for_build_wheel
返回挂钩(config_settings)
文件“c:\users\owner\appdata\local\temp\pip-build-env-zd2qhq\overlay\Lib\site-packages\setuptools\build_meta.py”,第 146 行,在 get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[‘wheel’])
文件“c:\users\owner\appdata\local\temp\pip-build-env-zd2qhq\overlay\Lib\site-packages\setuptools\build_meta.py”,第 127 行,在_get_build_requires
self.run_setup()
文件“c:\users\owner\appdata\local\temp\pip-build-env-zd2qhq\overlay\Lib\site-packages\setuptools\build_meta.py”,第 243 行,在 run_setup
self ).run_setup(setup_script=setup_script)
文件“c:\users\owner\appdata\local\temp\pip-build-env-zd2qhq\overlay\Lib\site-packages\setuptools\build_meta.py”,第 142 行,在 run_setup
执行(编译(代码,文件, ‘exec’), locals())
文件“setup.py”, line 448, in
main()
文件“setup.py”, line 99, in main
% {“ext”: re.escape(sysconfig.get_config_var( “EXT_SUFFIX”))}
文件“C:\Python27\lib\re.py”,第 210 行,转义
s = list(pattern)
TypeError:’NoneType’ 对象不可迭代


错误:命令出错,退出状态为 1:’C:\Python27\python.exe’ ‘C:\Python27\lib\site-packages\pip_vendor\pep517_in_process.py’ get_requires_for_build_wheel ‘c:\users\owner\appdata\local \temp\tmpvx6k6w’ 检查日志以获得完整的命令输出。

pip 安装失败 #1468

@kaipyroami所以对我有用的是在上面的命令之前运行它:
pip2 install opencv-python==4.2.0.32
然后在 bcnc install 它跳过 opencv-python

pip 安装失败 #1468
合作者

pip2 install opencv-python==4.2.0.32
然后在 bcnc install 它跳过 opencv-python

所以也许我们应该把这个 opencv 版本放到 setup.py 中?

pip 安装失败 #1468
悬崖彭纳利根 评论了 2020 年 9 月 30 日  

是的,我是这么认为的,或者像使用 pyserial 一样将版本限制在最大值

pip 安装失败 #1468
作者

@kaipyroami所以对我有用的是在上面的命令之前运行它:
pip2 install opencv-python==4.2.0.32
然后在 bcnc install 它跳过 opencv-python

繁荣!就是这样!
感谢您的快速解决!