“X的构建轮失败"是什么意思?在 pip 安装中? [英] What is the meaning of "Failed building wheel for X" in pip install?

查看:29
本文介绍了“X的构建轮失败"是什么意思?在 pip 安装中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是 SO 上一个真正受欢迎的问题,但我看过的许多答案中没有一个能清楚地解释这个错误的真正含义,以及它发生的原因.

This is a truly popular question here at SO, but none of the many answers I have looked at, clearly explain what this error really mean, and why it occurs.

混淆的一个来源是,当(例如)你执行 pip install pycparser 时,你首先得到错误:

One source of confusion, is that when (for example) you do pip install pycparser, you first get the error:

pycparser 的构建轮失败

然后是包裹是这样的消息:

which is then followed by the message that the package was:

成功安装pycparser-2.19.

# pip3 install pycparser

Collecting pycparser
  Using cached https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
Building wheels for collected packages: pycparser
  Running setup.py bdist_wheel for pycparser ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-g_v28hpp/pycparser/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-__w_f6p0 --python-tag cp36:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    ...
    File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2349, in resolve
      module = __import__(self.module_name, fromlist=['__name__'], level=0)
  ModuleNotFoundError: No module named 'wheel.bdist_wheel'

  ----------------------------------------
  Failed building wheel for pycparser
  Running setup.py clean for pycparser
Failed to build pycparser
Installing collected packages: pycparser
  Running setup.py install for pycparser ... done
Successfully installed pycparser-2.19

这是怎么回事?

(我想了解某些东西是如何失败但仍然可以安装的,以及您是否可以相信这个包可以正常运行?)

(I would like to understand how something can fail but still get installed and whether you can trust this package functioning correctly?)

到目前为止,我找到的最好的部分解释是这个.

So far the best partial explanation I have found is this.

推荐答案

因为,除了我自己,似乎没有人提到这个.我自己对上述问题的解决方案通常是确保使用以下方法禁用 缓存 副本:pip install --no-cache-dir.

Since, nobody seem to mention this apart myself. My own solution to the above problem is most often to make sure to disable the cached copy by using: pip install <package> --no-cache-dir.

这篇关于“X的构建轮失败"是什么意思?在 pip 安装中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆