问题:有与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
回答 1
回答 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
因此,我认为调用pyenv
RVM的替代品是合理的。
我在以下位置给出了其用法的完整详细示例:针对不同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