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 not accepting locally installed dev version of dependency #10817

Open
1 task done
tonyfm15 opened this issue Jan 21, 2022 · 7 comments
Open
1 task done

pip not accepting locally installed dev version of dependency #10817

tonyfm15 opened this issue Jan 21, 2022 · 7 comments
Labels
project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior

Comments

@tonyfm15
Copy link

tonyfm15 commented Jan 21, 2022

Description

I am trying to install a package with a mymodule~=0.16 dependency.

Locally, I have mymodule-0.16.0.dev1234 installed.

When I run pip install, I get the following error: ERROR: No matching distribution found for mymodule~=0.16

Expected behavior

I expect a pre-installed dev version to be accepted in place of the regular version.

From PEP 440 (https://www.python.org/dev/peps/pep-0440/#handling-of-pre-releases):

Pre-releases of any kind, including developmental releases, are implicitly excluded from all version specifiers, unless they are already present on the system, explicitly requested by the user, or if the only available version that satisfies the version specifier is a pre-release.

pip version

21.3.1

Python version

3.8.12

OS

macOS Monterey version 12.1

How to Reproduce

Unfortunately the two modules in question are proprietary so you cannot reproduce with the exact modules. But in general the steps are

  1. Install a X.Y.0.devZ version of a module.
  2. Install a module with a ~=X.Y requirement.

Output

$ pip install mymodule
...
...
Successfully installed mymodule-0.16.0.dev1234

$ pip install othermodule
Processing /path/to/othermodule
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
ERROR: Could not find a version that satisfies the requirement mymodule~=0.16 (from othermodule) (from versions: none)
ERROR: No matching distribution found for mymodule~=0.16

Code of Conduct

@tonyfm15 tonyfm15 added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 21, 2022
@jbylund
Copy link
Contributor

jbylund commented Jan 24, 2022

Does it make a difference if you specify the --pre flag to pip install?

@tonyfm15
Copy link
Author

Does it make a difference if you specify the --pre flag to pip install?

No, same error with pip install --pre othermodule

@uranusjr
Copy link
Member

uranusjr commented Feb 3, 2022

This is a bug in packaging, can you open an issue there? https://github.com/pypa/packaging/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

@uranusjr uranusjr added project: vendored dependency Related to a vendored dependency and removed S: needs triage Issues/PRs that need to be triaged labels Feb 3, 2022
@tonyfm15
Copy link
Author

tonyfm15 commented Feb 3, 2022

This is a bug in packaging, can you open an issue there? https://github.com/pypa/packaging/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

Done pypa/packaging#505

@tonyfm15
Copy link
Author

It looks like the packaging issue is closed, although I've still run into this issue in pip. Has the fix from packaging made its way to pip yet?

@q0w
Copy link
Contributor

q0w commented Mar 2, 2023

Pip still vendors the old version of packaging

@pradyunsg
Copy link
Member

Has the fix from packaging made its way to pip yet?

No. See #11715

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants