python - 将 virtualenv 实例/`requirements.txt` 转换为 pipenv

标签 python virtualenv pipenv

我有很多项目使用 virtualenvrequirements.txt./requirements/ 模式,但现在使用 pipenv 显然要优越很多倍。

pipenv 生成requirements.txt 似乎很容易,但反过来似乎更困惑。

似乎没有明显的方法可以将现有项目“转换”为 pipenv

我正在编写一个脚本来对大型 requirements.txt 中的所有内容执行 pipenv 但这不可能是正确的 - 有没有办法应用一个现有的 requirements.txt 到 pipenv

最佳答案

好吧,我想到了回答我自己的问题,并认为有可能采用“官方”/详细的方式来做到这一点:

$ pipenv shell
(env) $ pip install -r requirements

现在也存在:https://pipenv.kennethreitz.org/en/latest/basics/#importing-from-requirements-txt

$ pipenv install -r path/to/requirements.txt

真的,我只是误解了 pipenv 的抽象级别。

关于python - 将 virtualenv 实例/`requirements.txt` 转换为 pipenv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50081909/

相关文章:

python - 如何查看我的 conda 环境的创建日期?

python - Virtualenv 中的 TKinter

python - 如何将 pyinstaller 与 pipeline/pyenv 一起使用

python - 使用 libcurl4 导入 pycurl 会引发 ImportError

python - 如何使用 addItem 将 QPushButton 添加到 PyQtGraph?

python - 解码 Base64 字符串安全吗

python - 通过套接字发送包含文件的字典(python)

python - 使用 virtualenvwrapper 重命名环境

python - 如何使用 pipenv 解决 Python 包依赖?

python - Django - 将变量从函数 View 传递到 html 模板