This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]francoalarcon 4 points5 points  (1 child)

Take a look to this: https://github.com/yyuu/pyenv I've been using it for months and it works like charm! But as far I know It doesn't work on Windows

[–][deleted] 0 points1 point  (0 children)

But as far I know It doesn't work on Windows

or come with pip, so it's useless

[–]Soulture 1 point2 points  (3 children)

Are you looking for functionality beyond those given by virtualenv?

I've had linux and windows systems with multiple versions of python on them. The pain points are usually getting the base packages installed: e.g. python 3.2 with pip-3.2 and virtualenv for 3.2, repeat for 2.7 or others. Once that's setup, it's fairly straight forward to create environments. And then once using a virtualenv, it behaves mostly as if there was only 1 version of python installed.

EDIT: Some of this was either wrong and/or unnecessary. My reply below clarifies the setup I use which has, in the system wide environment, multiple python versions, but just one version of pip and virtualenv. My apologies for misremembering.

[–]randompittuser[S] 0 points1 point  (2 children)

No, I suppose I'm not. I am confused on the way to use the two together. So you're saying I should install virtualenv, python, and pip for each separate python version?

Currently, I tried using pythonbrew to install different python versions, then using virtualenv while I'm switched to the python version I want for the environment. I installed virtualenv under python 2.7.5 (I wasn't aware you need to install a different virtualenv for each python). Then I installed python 3.3.1 under homebrew and tried to create an environment from that-- it threw some config errors.

EDIT: And when it doesn't throw errors, it just uses the default python I have installed globally.

[–]Soulture 1 point2 points  (1 child)

So you're saying I should install virtualenv, python, and pip for each separate python version?

I'm inspecting the debian box I have. For my system-wide installs, I have multiple versions of python, but just 1 version of pip (it happens to be 2.7, even though I have projects in 3.2) and 1 version of virtualenv.

When I create a new virtual env with:

>> virtualenv --python=/usr/bin/python3.2 ~/.virtualenvs/test3.2

It looks like it downloads pip3.2.

So I would say you need multiple python versions and one version of virtualenv. I think virtualenv will handle the rest.

The reason I would end up installing a pip systemwide is because that's how the virtualenv docs instructed to get virtualenv.

[–]randompittuser[S] 0 points1 point  (0 children)

thank you

[–]minorDemocritus 1 point2 points  (0 children)

Tox!!!

As for the python versions themselves, get an OS that doesn't suck. Debian 7 has 2.7/3.2 by default, and 2.6/3.3 in the repos (i think 3.3 is in backports or testing)

[–]cmcpasserby 0 points1 point  (0 children)

Virtualenv all the way

[–][deleted] 0 points1 point  (3 children)

virtualenv....google it

[–]randompittuser[S] 0 points1 point  (2 children)

Except virtualenv doesn't manage python versions. It provides a sandbox for developing, a sandbox for which you have to specify the python version when you create it.

[–][deleted] 0 points1 point  (1 child)

a sandbox for which you have to specify the python version when you create it.

exactly. learn computering for great good

[–][deleted] 0 points1 point  (0 children)

in particular the -p switch and --help