You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installing a simple proof-of-concept package, poc, from a private Python Repo in Google Artifact Registry, I run pipenv lock to update Pipfile.lock, but the lock fails with pipenv.exceptions.ResolutionFailure.
Interestingly, I am able to install and lock pip's sampleproject from my same Python Repo in Google Artifact Registry.
Steps to Replicate
Used twine to upload my poc package to my private repo in Google Artifact Registry
Created a new pipenv environment and run pipenv shell
Installed keyrings.google-artifactregistry-auth in the virtual environment
Installed poc with pipenv install --skip-lock -i https://us-central1-python.pkg.dev/my-project/quickstart-python-repo/simple/ poc
Tried locking with pipenv lock
Expected result
I expect a simple update to the lockfile. My poc package has just one dependency: numpy. No other packages in the environment require numpy, so I am confident there is no issue with conflicting requirements.
NOTE sampleproject also has a single requirement: peppercorn. I've tried installing and locking sampleproject with peppercorn also being present in my private repo, and not being present. In both cases I am able to install and successfully lock.
This leads me to think that perhaps there is something weird about how I've constructed my package, since the sampleproject package can install perfectly well, regardless of whether its dependencies exist with it on my private repo, or elsewhere on the standard pypi repo. In case it's relevant, I'm attaching a zip file containing the poc package files as it is after running python setup.py sdist bdist_wheel: python-quickstart.zip
Actual result
When I run pipenv lock --verbose this is what I see:
(with-pipenv) ➜ with-pipenv pipenv lock --verbose
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
⠙ Locking...
ROUND 1
✘ Locking Failed!
Current constraints:
keyrings.google-artifactregistry-auth (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 3))
poc (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 2))
sampleproject (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 4))
Finding the best candidates:
found candidate keyrings.google-artifactregistry-auth==0.0.3 (constraint was <any>)
Traceback (most recent call last):
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 825, in resolve
results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 180, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 260, in _resolve_one_round
best_matches = {self.get_best_match(ireq) forireqin constraints}
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 260, in<setcomp>
best_matches = {self.get_best_match(ireq) forireqin constraints}
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 319, in get_best_match
best_match = self.repository.find_best_match(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 205, in find_best_match
raise NoCandidateFound(ireq, all_candidates, self.finder)
pipenv.patched.piptools.exceptions.NoCandidateFound: Could not find a version that matches poc (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 2))
No versions found
Was https://pypi.org/simple reachable?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 764, in<module>main()
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 758, in main
_main(parsed.pre, parsed.clear, parsed.verbose, parsed.system, parsed.write,
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 741, in _main
resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 702, in resolve_packages
results, resolver = resolve(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 684, in resolve
return resolve_deps(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1397, in resolve_deps
results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1110, in actually_resolve_deps
resolver.resolve()
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 835, in resolve
raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: ERROR: Could not find a version that matches poc (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 2))
No versions found
Was https://pypi.org/simple reachable?
ROUND 1
Current constraints:
keyrings.google-artifactregistry-auth (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 3))
poc (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 2))
sampleproject (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 4))
Finding the best candidates:
found candidate keyrings.google-artifactregistry-auth==0.0.3 (constraint was <any>)
Traceback (most recent call last):
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 825, in resolve
results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 180, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 260, in _resolve_one_round
best_matches = {self.get_best_match(ireq) forireqin constraints}
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 260, in<setcomp>
best_matches = {self.get_best_match(ireq) forireqin constraints}
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 319, in get_best_match
best_match = self.repository.find_best_match(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 205, in find_best_match
raise NoCandidateFound(ireq, all_candidates, self.finder)
pipenv.patched.piptools.exceptions.NoCandidateFound: Could not find a version that matches poc (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 2))
No versions found
Was https://pypi.org/simple reachable?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 764, in<module>main()
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 758, in main
_main(parsed.pre, parsed.clear, parsed.verbose, parsed.system, parsed.write,
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 741, in _main
resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 702, in resolve_packages
results, resolver = resolve(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 684, in resolve
return resolve_deps(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1397, in resolve_deps
results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1110, in actually_resolve_deps
resolver.resolve()
File "/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv/utils.py", line 835, in resolve
raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: ERROR: Could not find a version that matches poc (from -r /tmp/pipenvbej_ih0orequirements/pipenv-bsbdg8rz-constraints.txt (line 2))
No versions found
Was https://pypi.org/simple reachable?
Interestingly, the install and lock of my poc package succeeds if I install it dfirectly from a local wheel file: pipenv install pkg/poc-0.2.0-py3-none-any.whl
Another workaround could be to also have a requirements.txt, which you use with pip install -r requirements.txt after setting up the environment first via pipenv. Pip doesn't have an issue installing stuff from a private registry, but I'm not sure this is any better/worse than the other workaround
Issue description
After installing a simple proof-of-concept package,
poc
, from a private Python Repo in Google Artifact Registry, I runpipenv lock
to updatePipfile.lock
, but the lock fails withpipenv.exceptions.ResolutionFailure
.Interestingly, I am able to install and lock
pip
'ssampleproject
from my same Python Repo in Google Artifact Registry.Steps to Replicate
twine
to upload mypoc
package to my private repo in Google Artifact Registrypipenv shell
keyrings.google-artifactregistry-auth
in the virtual environmentpoc
withpipenv install --skip-lock -i https://us-central1-python.pkg.dev/my-project/quickstart-python-repo/simple/ poc
pipenv lock
Expected result
I expect a simple update to the lockfile. My
poc
package has just one dependency:numpy
. No other packages in the environment requirenumpy
, so I am confident there is no issue with conflicting requirements.NOTE
sampleproject
also has a single requirement:peppercorn
. I've tried installing and lockingsampleproject
withpeppercorn
also being present in my private repo, and not being present. In both cases I am able to install and successfully lock.This leads me to think that perhaps there is something weird about how I've constructed my package, since the
sampleproject
package can install perfectly well, regardless of whether its dependencies exist with it on my private repo, or elsewhere on the standardpypi
repo. In case it's relevant, I'm attaching a zip file containing thepoc
package files as it is after runningpython setup.py sdist bdist_wheel
: python-quickstart.zipActual result
When I run
pipenv lock --verbose
this is what I see:(with-pipenv) ➜ with-pipenv pipenv --support
$ pipenv --support
Pipenv version:
'2021.5.29'
Pipenv location:
'/home/nathanbudd/.local/lib/python3.8/site-packages/pipenv'
Python location:
'/usr/bin/python3'
Python installations found:
3.9.5
:/home/nathanbudd/.local/share/virtualenvs/with-pipenv-l5yzpNOn/bin/python3.9
3.9.5
:/home/nathanbudd/.local/share/virtualenvs/with-pipenv-l5yzpNOn/bin/python3
3.9.5
:/home/nathanbudd/.local/share/virtualenvs/with-pipenv-l5yzpNOn/bin/python3.9
3.9.5
:/home/nathanbudd/.local/share/virtualenvs/with-pipenv-l5yzpNOn/bin/python3
3.9.5
:/usr/bin/python3.9
3.9.5
:/bin/python3.9
3.8.10
:/usr/bin/python3.8
3.8.10
:/usr/bin/python3
3.8.10
:/bin/python3.8
3.8.10
:/bin/python3
2.7.18
:/usr/bin/python2.7
2.7.18
:/usr/bin/python2
2.7.18
:/bin/python2.7
2.7.18
:/bin/python2
PEP 508 Information:
System environment variables:
GJS_DEBUG_TOPICS
SSH_AUTH_SOCK
SESSION_MANAGER
GNOME_TERMINAL_SCREEN
SSH_AGENT_PID
XDG_CURRENT_DESKTOP
LANG
LANGUAGE
DEFAULTS_PATH
DISPLAY
COLORTERM
QT_IM_MODULE
GPG_AGENT_INFO
DESKTOP_SESSION
USER
XDG_MENU_PREFIX
HOME
GJS_DEBUG_OUTPUT
DBUS_SESSION_BUS_ADDRESS
PWD
GTK_MODULES
_
XDG_CONFIG_DIRS
XDG_SESSION_DESKTOP
JOURNAL_STREAM
WINDOWPATH
GNOME_DESKTOP_SESSION_ID
MANAGERPID
MANDATORY_PATH
LOGNAME
GNOME_TERMINAL_SERVICE
VTE_VERSION
PATH
XDG_RUNTIME_DIR
QT_ACCESSIBILITY
XMODIFIERS
XDG_SESSION_TYPE
GNOME_SHELL_SESSION_MODE
USERNAME
SHELL
INVOCATION_ID
SHLVL
XAUTHORITY
XDG_DATA_DIRS
XDG_SESSION_CLASS
TERM
GDMSESSION
IM_CONFIG_PHASE
OLDPWD
ZSH
PAGER
LESS
LSCOLORS
LS_COLORS
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PIPENV_ACTIVE
VIRTUAL_ENV
PS1
PIP_SHIMS_BASE_MODULE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_ACTIVE
:1
Debug–specific environment variables:
PATH
:/home/nathanbudd/.local/share/virtualenvs/with-pipenv-l5yzpNOn/bin:/home/nathanbudd/.poetry/bin:/home/nathanbudd/.local/bin:/home/nathanbudd/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/nathanbudd/.dotnet/tools
SHELL
:/bin/bash
LANG
:en_CA.UTF-8
PWD
:/home/nathanbudd/dev/test/car-python-quickstart/with-pipenv
VIRTUAL_ENV
:/home/nathanbudd/.local/share/virtualenvs/with-pipenv-l5yzpNOn
Contents of
Pipfile
('/home/nathanbudd/dev/test/car-python-quickstart/with-pipenv/Pipfile'):Contents of
Pipfile.lock
('/home/nathanbudd/dev/test/car-python-quickstart/with-pipenv/Pipfile.lock'):The text was updated successfully, but these errors were encountered: