Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install rope from archive (v.0.21.0) in isolated Python venv #441

Closed
RaiKoHoff opened this issue Nov 10, 2021 · 2 comments
Closed

pip install rope from archive (v.0.21.0) in isolated Python venv #441

RaiKoHoff opened this issue Nov 10, 2021 · 2 comments
Labels
bug Unexpected or incorrect user-visible behavior

Comments

@RaiKoHoff
Copy link

RaiKoHoff commented Nov 10, 2021

Using Python (v3.9.7) in a virtual environment (venv) in isolated (no web connection) mode:
installing rope v.0.21.1 from archive failed:
(installed "setuptools" version is v.58.5.3, "pip" version is v.21.3.1)

d:\develop\planning\trunk\python\venv\py_emb_397_32bit>python -I -m pip install --isolated --no-index rope-0.21.0.tar.gz
Processing .\rope-0.21.0.tar.gz
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'd:\develop\planning\trunk\python\venv\py_emb_397_32bit\python.exe' 'C:\Users\rkotten\AppData\Local\Temp\pip-standalone-pip-oytgro_b\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\rkotten\AppData\Local\Temp\pip-build-env-7ewvrzd7\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: --no-index -- 'setuptools>=40.8.0' wheel
       cwd: None
  Complete output (2 lines):
  ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
  ERROR: No matching distribution found for setuptools>=40.8.0
  ----------------------------------------
WARNING: Discarding file:///D:/develop/planning/trunk/python/venv/py_emb_397_32bit/rope-0.21.0.tar.gz. Command errored out with exit status 1: 'd:\develop\planning\trunk\python\venv\py_emb_397_32bit\python.exe' 'C:\Users\rkotten\AppData\Local\Temp\pip-standalone-pip-oytgro_b\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\rkotten\AppData\Local\Temp\pip-build-env-7ewvrzd7\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: --no-index -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
ERROR: Command errored out with exit status 1: 'd:\develop\planning\trunk\python\venv\py_emb_397_32bit\python.exe' 'C:\Users\rkotten\AppData\Local\Temp\pip-standalone-pip-oytgro_b\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\rkotten\AppData\Local\Temp\pip-build-env-7ewvrzd7\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: --no-index -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

While installing previous archive package "rope-0.20.1.tar.gz" in the same VENV works like a charm:

d:\develop\planning\trunk\python\venv\py_emb_397_32bit>python -I -m pip install --isolated --no-index rope-0.20.1.tar.gz
Processing .\rope-0.20.1.tar.gz
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: rope
  Building wheel for rope (setup.py) ... done
  Created wheel for rope: filename=rope-0.20.1-py3-none-any.whl size=183929 sha256=111f3bf923f95c60a168d605f44a26e8a422d51ed5bc090e0402fd24988edc3f
  Stored in directory: c:\users\name\appdata\local\pip\cache\wheels\a0\df\6d\fbabd41e3451dea532a8694b00c4f7a4f14d06cddbad3cbe3c
Successfully built rope
Installing collected packages: rope
Successfully installed rope-0.20.1

What am I missing ?

@RaiKoHoff RaiKoHoff added the bug Unexpected or incorrect user-visible behavior label Nov 10, 2021
@lieryan
Copy link
Member

lieryan commented Nov 11, 2021

Hi @RaiKoHoff, thanks for bringing up this issue.

It seems like the cause of this is because 0.21.0 starts using pyproject.toml, currently we don't use pyproject.toml to specify build/install environment, only to store black configuration, but pip seems to modify its installation behavior when this file exists in a way that breaks --no-index installs.

The reason why pip is trying to create a build environment seems to be because during installation, pip is trying to build a wheel package as 0.21.0 did not publish a wheel package. When building a wheel package, pip creates an isolated build environment (separate from your install environment) and tries to install setuptools there, which is why it doesn't use the installed setuptools.

I've published a new rope version 0.21.1 to PyPI, which now also start publishing wheel packages so pip should no longer need to build wheel during installation. In my testing, it seems like no-index install should work fine when installing from whl instead of tar.gz package. Can you try again by installing from the provided 0.21.1 wheel?

Alternatively, if you really have to use the source distribution, maybe try the workaround provided in pypa/pip#5696 by providing either a local index where pip can find a setuptools or by using --no-build-isolation?

@RaiKoHoff
Copy link
Author

Hi @lieryan,
now, with the provided rope v0.21.1 wheel, my packager fetches the wheel (automatically) instead of the archive (.tar.gz), which then has no problems anymore to get it pip installed in isolation mode.
So I didn't need to try the alternatives.

Thank you very much for the fast response and solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected or incorrect user-visible behavior
Projects
None yet
Development

No branches or pull requests

2 participants