我需要 virtualenv 吗? [英] Do I need virtualenv?

查看:30
本文介绍了我需要 virtualenv 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于每个项目和每个阶段(开发、生产、...),我使用不同的 linux 用户.我可以使用 pip 和 --user 选项在 $HOME 中安装软件包.

For every project and every stage (dev, prod, ...) I use a different linux user. I can use pip and the --user option, to install packages in $HOME.

我的隔离环境来自不同的 linux 用户.

My isolated environment comes form different linux users.

我可以从 virtualenv 中获得哪些好处?到目前为止,我认为没有理由使用 virtualenv.但也许我错过了一些东西.

Which benefits could I get from virtualenv? Up to now, I see no reason to use virtualenv. But maybe I am missing something.

Linux 用户名是这样构建的:project_name_S 和 S 是阶段(dev、qual、prod、testing).每个阶段可以在不同的主机上.

Linux user names are build like this: project_name_S and S is the stage (dev, qual, prod, testing). Each stage can be on a different host.

更新:

问这个问题三年多了:我现在使用 virtualenv.用户环境有问题.也许它现在有更好的支持.但是没有什么能阻止您在 $HOME 中创建 virtualenv :-)

More than three years after asking this question: I use virtualenv now. The user-environment was buggy. Maybe it has better support now. But nothing stops you from creating a virtualenv in $HOME :-)

推荐答案

创建 virtualenv 应该比创建新用户更快更容易.我不建议为现有项目切换,但可以考虑为新项目切换.

Creating a virtualenv sould be quicker and easier than creating a new user. I would not recomend switching for existing projects, but consider it for new projects.

这篇关于我需要 virtualenv 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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