`pipenv install` successfully installs a package from a GitLab project’s PyPI registry, but then fails in the locking step

  gitlab, pipenv, pypi, python

I’m using pipenv to install a package from the PyPI registry of a private GitLab project, like this:

pipenv install --index https://<my-gitlab-instance>/api/v4/projects/<my-project-id>/packages/pypi/simple <my-python-package>

The actual installation of the package succeeds, but the command later fails in the locking step. Here’s part of the command’s output:

Installing <my-python-package>...
Adding <my-python-package> to Pipfile's [packages]...
Installation Succeeded
Pipfile.lock (xxxxxx) out of date, updating to (yyyyyy)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
           Building requirements...
Resolving dependencies...
Locking Failed!

CRITICAL:pipenv.patched.notpip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement <my-python-package> (from versions: none)

The error message says it can’t find any version of the package… but it already found and installed a version of the package, so that makes no sense.

I confirmed that the package was installed by importing stuff from it in a python console in the pipenv virtual environment.

I’m using pipenv version 2021.11.15.

Any idea why the locking step fails or how I can debug it?

Source: Python Questions

LEAVE A COMMENT