简体   繁体   English

使用 pipenv.lock 文件克隆 repo 并重新创建 python 虚拟环境的过程是什么?

[英]What is the process to clone a repo and recreate the python virtual enviroment using the pipenv.lock file?

What is the process to clone a repo and recreate the python virtual environment using the pipenv.lock file?使用 pipenv.lock 文件克隆 repo 并重新创建 python 虚拟环境的过程是什么?

On my development system, I created a virtual environment using pyenv and pipenv, and am ready to test my code on another system.在我的开发系统上,我使用 pyenv 和 pipenv 创建了一个虚拟环境,并准备在另一个系统上测试我的代码。 I've installed pyenv/pipenv/python(same version as dev machine) on the test system, but I don't how to tell pipenv to create an identical virtual environment on the test system using the content of the version-controller Pipfile.lock file.我已经在测试系统上安装了 pyenv/pipenv/python(与开发机器的版本相同),但我不知道如何告诉 pipenv 使用版本控制器 Pipfile 的内容在测试系统上创建相同的虚拟环境。锁定文件。 do I do 'pipenv install --python '?我应该做'pipenv install --python'吗? or just 'pipenv install' and it will find and read the.lock file?或者只是'pipenv install',它会找到并读取.lock文件?

pipenv install --python <version> 
pipenv install

I expect a virtual environment with all of the requirements/dependencies specified in the lock file to be installed.我希望安装一个具有锁定文件中指定的所有要求/依赖项的虚拟环境。

According to this article it's just:根据这篇文章,它只是:

pipenv install --ignore-pipfile

This tells Pipenv to ignore the Pipfile for installation and use what's in the Pipfile.lock.这告诉 Pipenv 忽略 Pipfile 进行安装并使用 Pipfile.lock 中的内容。 Given this Pipfile.lock, Pipenv will create the exact same environment you had when you ran pipenv lock, sub-dependencies and all.鉴于此 Pipfile.lock,Pipenv 将创建与您在运行 pipenv 锁、子依赖项和所有内容时完全相同的环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM