共享 Virtualenv 环境定义 [英] Sharing Virtualenv environment definitions
问题描述
我有一个 heroku 项目,我想与其他人分享.正如说明描述,我使用virtualenv 来管理环境和依赖项.有没有办法在新机器上从 requirements.txt 重新创建 virtualenv 配置?
I have a heroku project I'm trying to share with someone else. As the instructions describe, I used virtualenv to manage the environment and dependencies. Is there a way to recreate the virtualenv configuration from the requirements.txt on a new machine?
我知道这个问题,但这描述了在用户帐户之间共享 virtualenv在同一台机器上.我正在寻找一种跨机器共享它的方法.
I'm aware of this question, but that describes sharing the virtualenv between user accounts on the same machine. I'm looking for a way of sharing it across machines.
推荐答案
没有一种方法可以轻松地跨机器完全共享它.最方便的是创建 virtualenv 然后重新安装依赖项:
There isn't a way to easily fully share it across machines. The most convenient thing would be to create the virtualenv then re-install the dependencies fresh:
virtualenv --no-site-packages venv
source venv/bin/activate
pip install -r requirements.txt
这篇关于共享 Virtualenv 环境定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!