Python 是否有像 Ruby 的 rvm 一样强大的东西?

发布于 2024-09-14 10:24:09 字数 973 浏览 14 评论 0原文

这不是此问题的重复项。

我已经知道 virtualenvvirtualenvwrapperpip > 但他们似乎并不完全有我想要的东西。

我正在寻找一种方法,不仅可以安装多个版本的 Python,还可以安装多个版本的 Django(例如),并混合和匹配 python 的“活动”版本和 Django 的“活动”版本。

例如,我有 Django 1.0、1.1 和 1.2,并且 trunk 处于“活动”状态。我希望能够在 Python 2.5、2.6 和 2.7 上测试它。然后使 Django 1.2“活跃”并再次在我的所有 Python 版本上进行测试。

我可以看到如何通过使用 virtualenv 来实现该示例,但是假设我有 5 个版本的 Django 应用程序,我想在 Python 2.5、2.6 和 2.7 以及 Django 版本 1.0、1.1 和 1.0、1.1 和1.2.现在,据我所知,我需要创建的虚拟环境的数量变得难以管理。

我只想说,让Python版本X“活跃”,让Django版本X“活跃”,让MyApp版本X“活跃”,而不必处理创建和切换virtualenvs(我绝对不这样做)不想做一堆引导脚本)。

我正在寻找的东西是否存在于Python中,或者我是否缺少一些关于virtualenv、virtualenvwrapper和pip的东西,它们已经可以优雅地处理这个问题了?

This is not a duplicate of this question.

I am already aware of virtualenv and virtualenvwrapper and pip but they don't quite seem to have exactly what I want.

I'm looking for a way that I can not only have multiple versions of Python installed but also multiple versions of Django (for example) and mix and match the "active" version of python and the "active" version of Django.

e.g. I've got Django 1.0, 1.1, and 1.2, and trunk is "active". I want to be able to test it on Python 2.5, 2.6 and 2.7. Then make Django 1.2 "active" and test it on all of my Python versions again.

I can see how I could potentially get by using virtualenv for that example, but say I've got 5 releases of a Django application that I want to test on every combination of Python 2.5, 2.6 and 2.7 and Django versions 1.0, 1.1, and 1.2. At this point, afaik, the number of virtual environments that I'm going to need to create is becoming unmanageable.

I'd like to just be able to say, make Python version X "active", make Django version X "active", and make MyApp version X "active" without having to deal with creating and switching virtualenvs (and I definitely don't want to be doing a bunch of bootstrap scripting).

Does the thing that I'm looking for exist for Python, or is there something that I'm missing about virtualenv, virtualenvwrapper, and pip that can already handle this elegantly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蹲墙角沉默 2024-09-21 10:24:09

我相信 pythonbrew 就是您正在寻找的。

编辑pyenv 看起来像是自 2013 年以来的首选解决方案。

I believe pythonbrew is what you're looking for.

Edit: pyenv looks like the preferred solution since 2013.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文