这是一个非常受欢迎的问题,但我所看到的许多答案中,没有一个能清楚地解释这个错误的真正含义,以及它为什么会发生。

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

pycparser构建转轮失败

后面跟着一个消息,这个包是:

成功安装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('\r\n', '\n');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

这是怎么回事?

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

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


当前回答

我试图安装python-nmap工具,并得到这个错误。

如果您是在Linux平台上,请确保nmap工具已安装,否则python-nmap库将无法工作。

在基于Red Hat的发行版上,请按如下方式安装nmap命令行:

sudo yum install namp

其他回答

当您没有wheel所需的包时,通常会出现此错误。 如果您正在使用python3,则安装python3-dev或python2-dev(如果您正在使用python2)。

sudo apt-get install python3-dev 

or

sudo apt-get install python2-dev

在Ubuntu 18.04上,我遇到了这个问题,因为wheel的apt包不包括wheel命令。我认为pip尝试导入wheel python包,如果导入成功,则假定wheel命令也可用。Ubuntu打破了这个假设。

apt的python3代码包被命名为python3-wheel。这是自动安装的,因为python3-pip推荐它。

apt的python3 wheel命令包命名为python-wheel-common。安装这个也修复了“失败的建设车轮”的错误。

错误:

系统:aws ec2实例(t2小)

问题:在安装opencv python via

Pip3安装opencv-python

  Problem with the CMake installation, aborting build. CMake executable is cmake
  
  ----------------------------------------
  Failed building wheel for opencv-python
  Running setup.py clean for opencv-python

什么对我有用

Pip3安装——升级PIP setuptools轮

在此之后,您仍然可能收到休闲错误错误

    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

安装libgl为我解决了这个错误。

sudo apt update
sudo apt install libgl1-mesa-glx

希望这能有所帮助

当我试图安装一个需要'isal'的包时,我被这个问题困扰了几个小时,但isal安装失败了:

  ----------------------------------------
  ERROR: Failed building wheel for isal
Failed to build isal
ERROR: Could not build wheels for isal which use PEP 517 and cannot be installed directly

适合我的解决方案是安装libtool。

yum install libtool

试试这个:

Sudo apt-get install libpcap-dev libpq-dev

当我安装这两个时,它已经为我工作了。

更多信息请参见这里的链接