Create new Pipfile.lock with old package versions

86 views Asked by At

I have a Docker container where pipenv install --system --dev --skip-lock was used to install packages from a Pipfile (some weeks ago). Unfortunately there is no Pipfile.lock, so if I rebuild the Docker image now it uses different versions of the dependencies. Therefore I want to create a Pipfile.lock now, so that in the future we use known versions of all dependencies. But I fail to generate a Pipfile.lock with the exact versions that are installed in the container!

If I run pipenv lock it creates a Pipfile.lock which contains the latest versions of the dependencies, rather than the old versions that are installed in the old Docker image.
If I run pipenv lock --keep-outdated it complains ERROR:: Pipfile.lock must exist to use --keep-outdated!.
If I run pip freeze > requirements.txt; pipenv install -r requirements.txt it fails because the Docker image also contains some Python packages that were installed from other sources and which apparently cannot be installed with pipenv.

How can I create a Pipfile.lock that contains exactly the dependency versions that are installed in the Docker container? It seems to be a simple thing (just write the Pipfile.lock as done by pipenv lock, but don't try to update first); but I can't seem to find the correct command.

0

There are 0 answers