标签归档:equivalent

有与Ruby的“ rvm”等效的python吗?

问题:有与Ruby的“ rvm”等效的python吗?

问:在Python中,我们有功能上与Ruby版本管理器“ rvm”等效的功能吗?


RVM使您可以轻松地在不同版本的ruby解释器不同组的gem(模块)之间进行完全切换。有关解释器 gems的download-build-install-switch的一切,都可以通过调用rvm来解决。全部以您的普通用户帐户运行。)

Q: Do we have anything functionally equivalent in Python to the Ruby version manager ‘rvm’?


(RVM lets you easily switch completely between different versions of the ruby interpreter and different sets of gems (modules). Everything concerning download-build-install-switch of interpreter(-s) and gems gets taken care of by invoking rvm. It is all run under your regular user account.)


回答 0

是的,它与virtualenvwrapper一起是virtualenv

更新:您可以一次安装virtualenv burrito

更新:正确的答案现在可能是pyenv

对于科学计算,相应的工具是anaconda

Yes, it is virtualenv along with virtualenvwrapper.

update: you may install both at once with virtualenv burrito.

Update: the correct answer is now probably pyenv.

For scientific computing, the corresponding tool is anaconda.


回答 1

Pythonbrew不再在开发中。前维护者建议改用“ PyEnv”(见下文)”。

pythonbrew来了! http://github.com/utahta/pythonbrew

pyenv:https//github.com/yyuu/pyenv

Pythonbrew is no longer under development. The former maintainer suggests to use “PyEnv” instead (see below)”.

pythonbrew has come! http://github.com/utahta/pythonbrew

pyenv: https://github.com/yyuu/pyenv


回答 2

我创建了pyenv,它是Ruby的rbenv的一个分支,并针对Python进行了修改。像pythonz一样,pyenv还支持Stackless,PyPy和Jython。

I created pyenv which is a fork of Ruby’s rbenv and modified for Python. Like pythonz, pyenv also supports Stackless, PyPy, and Jython.


回答 3

跟进hytdsh的回答(近两年后)…

pythonz pythonbrew的一个分支,增加了对Stackless,PyPy和Jython的支持。

如果您喜欢rvm处理不同解释器的方式,那么可能值得看看pythonz。如果您严格使用CPython,则差异不那么明显。

Following up on hytdsh’s answer (nearly two years later)…

pythonz a fork of pythonbrew that adds support for Stackless, PyPy, and Jython.

If you like how rvm handles different interpreters, it may worth taking a look at pythonz. If you’re strictly working with CPython, the difference is less significant.


回答 4

或者,如果您使用的是Macports,则可以使用python_select。安装python_select方式:

$ sudo port install python_select

假设python 2.6和2.5通过Macports安装了bee,则可以像这样切换python:

$ sudo python_select python25
=> Selecting version "python25" for python
$ python --version
=> 2.5.5
$ sudo python_select python26
=> Selecting version "python26" for python
$ python --version
=> 2.6.6

Optionally, if you’re using Macports you can use python_select. Install python_select with:

$ sudo port install python_select

Assuming python 2.6 and 2.5 have bee installed via Macports you can switch pythons like so:

$ sudo python_select python25
=> Selecting version "python25" for python
$ python --version
=> 2.5.5
$ sudo python_select python26
=> Selecting version "python26" for python
$ python --version
=> 2.6.6

回答 5

pyenv 1.2.15可以为您构建和安装Python

也许这在早期版本中是不可能的,但是当我在1.2.15中进行测试时,我注意到该pyenv install选项有效:

pyenv install 3.8.0

因此,我认为调用pyenvRVM的替代品是合理的。

我在以下位置给出了其用法的完整详细示例:针对不同python版本的apt-get install

pyenv 1.2.15 can build and install Python for you

Maybe this was not possible in earlier version, but when I tested in 1.2.15 I noticed the pyenv install option which worked:

pyenv install 3.8.0

Therefore I feel that it is reasonable to call pyenv a replacement for RVM.

I have given a fully detailed example of its usage at: apt-get install for different python versions