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

Installing with --python-version doesn't resolve deps for indicated version #12770

Closed
1 task done
jaraco opened this issue Jun 17, 2024 · 2 comments
Closed
1 task done
Labels
C: dependency resolution About choosing which dependencies to install resolution: duplicate Duplicate of an existing issue/PR type: bug A confirmed bug or unintended behavior

Comments

@jaraco
Copy link
Member

jaraco commented Jun 17, 2024

Description

I recently attempted to install to --target using --python-version. After learning that I also had to supply --only-binary :all:, the command completed, but relevant dependencies dependent on the Python version were missing.

 @ py -m pip install --python-version 3.8 --only-binary :all: -t ~/.local/pip-run pip-run
...
 @ env PYTHONPATH=~/.local/pip-run py -3.8 -m pip-run
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.8.19/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Cellar/[email protected]/3.8.19/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/jaraco/.local/pip-run/pip-run.py", line 1, in <module>
    from pip_run import run
  File "/Users/jaraco/.local/pip-run/pip_run/__init__.py", line 3, in <module>
    from . import commands, deps, launch, scripts
  File "/Users/jaraco/.local/pip-run/pip_run/commands.py", line 6, in <module>
    from jaraco.context import suppress
  File "/Users/jaraco/.local/pip-run/jaraco/context.py", line 17, in <module>
    from backports import tarfile
ModuleNotFoundError: No module named 'backports'

It seems backports.tarfile wasn't installed, even though it's required on Python 3.8.

Expected behavior

Install with --python-version should resolve dependencies the same as if the command had been run on that Python version.

pip version

24.0

Python version

3.12

OS

Windows/macOS

How to Reproduce

See description

Output

No response

Code of Conduct

@jaraco jaraco added type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jun 17, 2024
@ichard26
Copy link
Member

This is likely a manifestation of #11664.

@ichard26 ichard26 added C: dependency resolution About choosing which dependencies to install resolution: duplicate Duplicate of an existing issue/PR and removed S: needs triage Issues/PRs that need to be triaged labels Jun 22, 2024
@ichard26
Copy link
Member

Actually, I'm just going to merge this into #11664.

@ichard26 ichard26 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2024
jaraco added a commit to pypa/setuptools that referenced this issue Jul 2, 2024
jaraco added a commit to pypa/setuptools that referenced this issue Jul 3, 2024
jaraco added a commit to pypa/setuptools that referenced this issue Jul 21, 2024
More durable workaround for pypa/pip#12770. Ref #4492.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: dependency resolution About choosing which dependencies to install resolution: duplicate Duplicate of an existing issue/PR type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants