question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install with --no-binary ignores PEP 517 build system

See original GitHub issue

Environment

  • pip version: 19.0.1
  • Python version: 3.7
  • OS: Linux

Description

In a clean environment, run:

pip install --no-binary :all: flit

The output includes this:

Skipping bdist_wheel for flit, due to binaries being disabled for it.
...
  Running setup.py install for flit ... error
    Complete output from command /home/takluyver/miniconda3/envs/pip19/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ud6iwhp3/flit/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-wsv_33qq/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'

Pip 19 is aware of PEP 517, and uses it if you do pip wheel --no-binary :all: flit (the output includes Building wheel for flit (PEP 517) ... done). But when installing from an sdist, it seems to default to running setup.py install instead of building a wheel using the PEP 517 backend and installing that.

This is a problem in practice because pip does respect the PEP 518 build dependencies and create an isolated build environment, without setuptools. Setuptools is not required to build with the PEP 517 backend, but it is if you use the fallback setup.py script.

It appears that the no-binary option disables the ‘build a wheel and install that’ pathway. But I think that option is generally taken to mean ‘download the sdist rather than the published wheel’. The plan is for all PEP 517 installations to work by building a wheel and then installing that.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
dstufftcommented, Feb 4, 2019

Yea, --no-binary should only be able what format we source a package from, not whether or not we route things through wheels to begin with, or whether or not we cache them.

0reactions
pradyunsgcommented, Oct 18, 2019

Shout-out to @seppeljordan for actually fixing this! ^.^

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not build wheels for _ which use PEP 517 and cannot ...
The easiest solution to deal with the error "Could not build wheels for ____ which use PEP 517 and cannot be installed directly"....
Read more >
PEP 517 Backend bootstrapping - Discussions on Python.org
If you specify --no-binary :all: , you will try to install setuptools from an sdist, and if PEP 517 is enabled that will...
Read more >
pip-wheel command man page - python3-pip | ManKier
Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour). --check-build-dependencies. Check the build dependencies when ...
Read more >
pip install - pip documentation v21.1.dev0
Build dependencies specified by PEP 518 must be already installed if this option is used. --use-pep517 ¶. Use PEP 517 for building source...
Read more >
This Way Up: A Bottom-Up Look At Python Packaging
Tools for automatically downloading and installing Python packages from the ... The primary benefit of PEP 517 is that it frees 3rd party...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found