alembic: v1.4.2 missing wheel when pip download and then pip install from .tar.gz

When I pip download alembic==1.4.2 and then pip install alembic from the downloaded .tar.gz file, then I get the following error:

  ERROR: Command errored out with exit status 1:                                                                                                                                                            
   command: /home/myself/anaconda3/envs/tmp3/bin/python /home/myself/anaconda3/envs/tmp3/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-c_bv0n7g/overlay
 --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links /home/myself/workspace/my_project/./ -- 'setuptools>=40.8.0' wheel                                          
       cwd: None                                                                                                                                                                                            
  Complete output (4 lines):                                                                                                                                                                                
  Looking in links: /home/myself/workspace/my_project/./                                                                                                                                               
  Processing ./setuptools-46.0.0-py3-none-any.whl                                                                                                                                                           
  ERROR: Could not find a version that satisfies the requirement wheel (from versions: none)                                                                                                                
  ERROR: No matching distribution found for wheel                                                                                                                                                           
  ----------------------------------------                                                                                                                                                                  
ERROR: Command errored out with exit status 1: /home/myself/anaconda3/envs/tmp3/bin/python /home/myself/anaconda3/envs/tmp3/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix
/tmp/pip-build-env-c_bv0n7g/overlay --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links /home/myself/workspace/my_project/./ -- 'setuptools>=40.8.0' wheel Check
the logs for full command output.

However, the same procedure works with the versions before, like 1.4.1.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (13 by maintainers)

Most upvoted comments

My hint comes from the error on install of setuptools. My guess is:

  • 1.4.2 added pyproject.toml
  • pyproject.toml makes pip first try to install using pep517
  • pep517 requires setuptools
  • the machine is offline so it does fail the install if setuptools is not already installed.

Could you try using --no-use-pep517 to see if that is indeed the case?

pip install --no-use-pep517 alembic-1.4.2.tar.gz works, so given @zzzeek’s comment in sqlalchemy/sqlalchemy#5207 about conforming to best practices it’s up to me now to install with the --no-use-pep517 flag whenever I’m offline?

@pganssle there is no musl platform tag to my knowledge because I don’t think distutils supports it (see https://github.com/pypa/packaging/issues/259).

It actually can happen, since I’ve experienced the same behavior with other packages, that install with a wheel on other linux distribution, but from source in alpine

Sorry, to be clear I meant that I don’t know if there’s a platform tag for musl targets. I think it’s possible that on alpine you can only install universal wheels, locally-built wheels or install from source.

@CaselIT The issue is not that pip requires it but that alembic requires it to build a wheel, and pip is moving to a system where the workflow always goes through a wheel.

The idea with PEP 517 is that when building from source distributions, the steps go like this:

  1. Front-end (pip) queries a project for its list of build-time dependencies. In this case you are using the default, setuptools and wheel, but you may have things like Cython or flit in there instead.
  2. pip creates an isolated environment (like a virtual environment) and installs all the build-time dependencies into it (these do not persist to runtime).
  3. pip induces the backend (setuptools, in this case) to build a wheel.
  4. pip installs the wheel.

Note that when you do it this way, if you get a wheel from any other source, pip’s installation works the exact same way.

What pip wheel does is that it creates a “wheelhouse” which is a store of wheels that you can use to install whatever it is you need (including all its dependencies). It will try to download those wheels from PyPI first before building them.

So I would not expect pip wheel to install wheel in your environment, it will just install it in the isolated build environment when building a wheel for alembic, and then pip install -t MY_WHEELHOUSE alembic will just work (because the dependency on wheel only exists when you are building the wheel, not at install time).

So, like I said, the original poster can either include the appropriate build-time dependencies in their local mini-index or they can use pip wheel to build their mini-index instead of pip download, in which case they won’t need the build-time dependencies.