共享 Virtualenv 环境定义 [英] Sharing Virtualenv environment definitions

查看:28
本文介绍了共享 Virtualenv 环境定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆