Is there a python equivalent of Ruby's 'rvm'?
Asked Answered
N

6

146

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.)

Normalie answered 11/5, 2010 at 16:25 Comment(0)
A
99

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.

Asinine answered 11/5, 2010 at 16:27 Comment(9)
Ah, yeah because virtualenv by itself is too low level for pretty much any use other than creating your own wrapper... Thanks for the pointer, I'm looking at vimeo.com/5894881 now :)Normalie
I'm confused. Where can you install different versions of python? It seems to be just using the system's version of python.Wellordered
Each virtualenv is tied to a particular version of Python. You may thus use different versions of Python across your virtualenvs.Asinine
But is there a way to bundle a specific Python install (say, 2.7) with certain eggs in one project, and with certain other eggs in another? RVM manages all this stuff seamlessly, and sudo is a thing of the past.Citizenry
Virtualenv allows to juggle between versions of Python, and between different sets of eggs; but it won't deal with the compilation+installation of Python itself. RVM does exactly that for Ruby. If you want to build a specific version of Python because you can't install it out of packages for some reason, then you want to check pythonbrew instead (just the other answer just below).Aggi
I don't see how this supports several versions of python.Sainthood
RVM does take care for compiling Ruby interpreters. It also allows downloading precompiled ones, if available.Nickel
I really like your use of strikethrough to show what used to work compared to what you felt was best after your latest edit.Eyeshot
@Wellordered this is now possible it seems: https://mcmap.net/q/15418/-is-there-a-python-equivalent-of-ruby-39-s-39-rvm-39Mind
S
86

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

Spaghetti answered 17/10, 2010 at 12:32 Comment(7)
Interesting, might be worth a try. I see that its command invocations are quite similar that of to rvm...Normalie
As someone who is quite adept to rvm, pythonbrew was an absolute breeze to get accustomed to. Thanks for the tip!Eldin
Thank you very much. I believe this is the real answer from now on.Cavalryman
Should add be good to see pypy and jython added to the list of known pythons.Cavalryman
Not that much of traffic anymore. Is this still worth looking into?Textualist
but it only supports CPython, not Jython and pypy. RVM supports all kinds of Rubies.Gunpoint
Now the readme file says that it "is no longer under active development". :(Gladiolus
L
52

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

Lenticularis answered 3/10, 2012 at 4:2 Comment(0)
K
6

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.

Kolyma answered 22/9, 2012 at 19:31 Comment(0)
D
5

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
Decastro answered 13/1, 2011 at 19:15 Comment(0)
M
2

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

Mind answered 10/12, 2019 at 13:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.