title: What is the meaning of "Failed building wheel for X" in pip install?
body: <p>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. </p>
  
  <p>One source of confusion, is that when (for example) you do <code>pip install pycparser</code>, you first get the error:</p>
  
  <p><strong><code>Failed building wheel for pycparser</code></strong></p>
  
  <p>which is then followed by the message that the package was: </p>
  
  <p><strong><code>Successfully installed pycparser-2.19</code></strong>.</p>
  
  <hr>
  
  <pre class="lang-none prettyprint-override"><code># 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 "&lt;string&gt;", line 1, in &lt;module&gt;
      ...
      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
  </code></pre>
  
  <p><strong>What is going on here?</strong></p>
  
  <p>(I would like to understand how something can fail but still get installed and whether you can trust this package functioning correctly?)</p>
  
  <p>So far the best partial explanation I have found is <a href="https://stackoverflow.com/a/37693431/">this</a>.</p>