Skip to content

pip's error message for wheel-build failure on PEP517 packages isn't very friendly #6256

@Julian

Description

@Julian

Environment

  • pip version: 19.0.2
  • Python version:
Python 2.7.13 (ab0b9caf307db6592905a80b8faffd69b39005b8, Sep 30 2018, 13:49:36)
[PyPy 6.0.0 with GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.2)]
  • OS: macOS

Description
When pip fails to build a wheel, a fairly cryptic message appears for someone not "intimately" aware of the Python packaging ecosystem:

(The below is with cryptography, which does not publish macOS wheels for PyPy, but should fail the same way for any similar failure).

⊙  pypy ~/Development/virtualenv/virtualenv.py venv && venv/bin/pip install --quiet cryptography                                                                                                                                       jberman@USNYHJBERMANMB2
New pypy executable in /Users/jberman/Desktop/venv/bin/pypy
Installing setuptools, pip, wheel...done.
DEPRECATION: A future version of pip will drop support for Python 2.7.
/Users/jberman/Desktop/venv/site-packages/pip/_vendor/msgpack/fallback.py:222: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  PendingDeprecationWarning)
  Failed building wheel for cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

I wouldn't expect a random Python developer to know what PEP517 is (today?) in isolation. The error message appears to just be a way of saying "building the wheel failed, for reasons like e.g. not being able to find OpenSSL in this specific case, but more generically the compiler or some other thing in the build toolchain exiting unsuccessfully".

These appear to be the relevant pip source lines.

Expected behavior
Ideally an error message that could be understood in isolation would be nice -- I can't tell immediately the specific set of things that need to happen to trigger that branch in the code, but my best guess at the minute would be something like `Building a wheel failed. See above for details of the specific error. Refusing to attempt an sdist build because uses features present only in PEP517. See for details and <foo's setup.py presumably, ideally with some specific info on what feature it uses?> for specifics."

FWIW the old version of this error was not any more friendly. On pip 18.x:

Command "/Users/jberman/Desktop/venv/bin/pypy -u -c "import setuptools, tokenize;__file__='/private/var/folders/46/1d5dl2sn5n9b0f3pd8lbvz9hhr5mnp/T/pip-install-96YFMf/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/46/1d5dl2sn5n9b0f3pd8lbvz9hhr5mnp/T/pip-record-kUXGwh/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jberman/Desktop/venv/include/site/python2.7/cryptography" failed with error code 1 in /private/var/folders/46/1d5dl2sn5n9b0f3pd8lbvz9hhr5mnp/T/pip-install-96YFMf/cryptography/

which is close to gibberish, but I guess I was conditioned to tune out that line and just focus on the one above it that says building the wheel failed -- but ideally if the error message is changing, would be nice to show something that could help the person seeing it to know what to do.

How to Reproduce / Output
(See above shell line)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions