pipenv install behaves different if using >= instead of ==
See original GitHub issuetl;dr pipenv compares version strings differently if install
parameter has version selection operator >=
, e.g. >=4.0b
vs. ==4.0b
.
Running pipenv install 'pyyaml>=4.2b1'
within a pipenv virtual environment fails with message Could not find a version that matches pyyaml>=4.2b1
.
`pipenv install 'pyyaml>=4.2b1'` output
PS> mkdir test8
PS> cd test8
PS> pipenv --version
pipenv, version 2018.11.26
PS> pipenv shell
Creating a virtualenv for this project…
Pipfile: C:\Users\user1\Projects\test8\Pipfile
Using c:\python\python37\python.exe (3.7.1) to create virtualenv…
[ =] Creating virtual environment...Already using interpreter c:\python\python37\python.exe
Using base prefix 'c:\\python\\python37'
New python executable in C:\Users\user1\.virtualenvs\test8-PXjge-vL\Scripts\python.exe
Installing setuptools, pip, wheel...
done.
Successfully created virtual environment!
Virtualenv location: C:\Users\user1\.virtualenvs\test8-PXjge-vL
Creating a Pipfile for this project…
Launching subshell in virtual environment…
Windows Powershell 5.1.17763.316
Copyright (C) Microsoft Corporation. All rights reserved.
PS> pipenv install 'pyyaml>=4.2b1'
Installing pyyaml>=4.2b1…
Adding pyyaml to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Locking Failed!
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "c:\python\python37\lib\site-packages\pipenv\utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "c:\python\python37\lib\site-packages\pipenv\utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "c:\python\python37\lib\site-packages\pipenv\utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches pyyaml>=4.2b1
[pipenv.exceptions.ResolutionFailure]: Tried: 3.10, 3.10, 3.11, 3.11, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13
[pipenv.exceptions.ResolutionFailure]: Skipped pre-versions: 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 4.2b1, 4.2b2, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 5.1b1, 5.1b3
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches pyyaml>=4.2b1
Tried: 3.10, 3.10, 3.11, 3.11, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13
Skipped pre-versions: 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 4.2b1, 4.2b2, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 5.1b1, 5.1b3
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]: File "c:\python\python37\lib\site-packages\pipenv\utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "c:\python\python37\lib\site-packages\pipenv\utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "c:\python\python37\lib\site-packages\pipenv\utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches pyyaml>=4.2b1
[pipenv.exceptions.ResolutionFailure]: Tried: 3.10, 3.10, 3.11, 3.11, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13
[pipenv.exceptions.ResolutionFailure]: Skipped pre-versions: 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 4.2b1, 4.2b2, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 5.1b1, 5.1b3
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches pyyaml>=4.2b1
Tried: 3.10, 3.10, 3.11, 3.11, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.12, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13, 3.13
Skipped pre-versions: 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13b1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 3.13rc1, 4.2b1, 4.2b2, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 4.2b4, 5.1b1, 5.1b3
There are incompatible versions in the resolved dependencies.
Yet pipenv install 'pyyaml==4.2b1'
succeeds
`pipenv install 'pyyaml==4.2b1' output
PS> pipenv install 'pyyaml==4.2b1'
Installing pyyaml==4.2b1…
Adding pyyaml to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Success!
Updated Pipfile.lock (bf53d5)!
Installing dependencies from Pipfile.lock (bf53d5)…
================================ 1/1 - 00:00:02
Problems I see:
- pipenv appears to behave differently for version selection operator
>=
- pipenv does not log the version it parsed. I don’t know if pipenv parsed the passed version value as
4.2b1
or=4.2b1
or>=4.2b1
or something else.
Similar to Issue #3568 (and others).
$ pipenv --support
Pipenv version: '2018.11.26'
Pipenv location: 'c:\\python\\python37\\lib\\site-packages\\pipenv'
Python location: 'c:\\python\\python37\\python.exe'
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.7.1',
'os_name': 'nt',
'platform_machine': 'AMD64',
'platform_python_implementation': 'CPython',
'platform_release': '10',
'platform_system': 'Windows',
'python_full_version': '3.7.1',
'python_version': '3.7',
'sys_platform': 'win32'}
Pipenv–specific environment variables:
PIPENV_ACTIVE
:1
Debug–specific environment variables:
VIRTUAL_ENV
:C:\Users\user1\.virtualenvs\test8-PXjge-vL
Contents of Pipfile
(‘C:\Users\user1\OneDrive\Projects\test8\Pipfile’):
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
pyyaml = "==4.2b1"
[requires]
python_version = "3.7"
Contents of Pipfile.lock
(‘C:\Users\user1\OneDrive\Projects\test8\Pipfile.lock’):
{
"_meta": {
"hash": {
"sha256": "d040cd80066475107689295402b3ff9aef71f7cdf6f1b795ab0f19a26dbf53d5"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"pyyaml": {
"hashes": [
"sha256:2c6b1522d651e6264cec4e3d59eda497aec576ce4f39d389ed77dc6c3748c598",
"sha256:ef3a0d5a5e950747f4a39ed7b204e036b37f9bddc7551c1a813b8727515a832e"
],
"index": "pypi",
"version": "==4.2b1"
}
},
"develop": {}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@jtmoon79 It is described in
pipenv install --help
,pipenv --help
is for showing available commands and global options.I should add,
--pre
is not described in thepipenv --help
. It is alluded to in one--help
example but not adequately articulated.Using
pipenv, version 2018.11.26
.