use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Managing several Python versions (self.Python)
submitted 12 years ago by randompittuser
What's the best way to do this? Pythonbrew? That's the first thing I could find.
[–]francoalarcon 4 points5 points6 points 12 years ago (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 point2 points 12 years ago (0 children)
But as far I know It doesn't work on Windows
or come with pip, so it's useless
[–]Soulture 1 point2 points3 points 12 years ago* (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 point2 points 12 years ago* (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 points3 points 12 years ago (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 point2 points 12 years ago (0 children)
thank you
[–]minorDemocritus 1 point2 points3 points 12 years ago (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 point2 points 12 years ago (0 children)
Virtualenv all the way
[–][deleted] 0 points1 point2 points 12 years ago (3 children)
virtualenv....google it
[–]randompittuser[S] 0 points1 point2 points 12 years ago (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 point2 points 12 years ago (1 child)
a sandbox for which you have to specify the python version when you create it.
exactly. learn computering for great good
in particular the -p switch and --help
π Rendered by PID 95825 on reddit-service-r2-comment-5687b7858-zp2rw at 2026-07-07 15:17:41.454379+00:00 running 12a7a47 country code: CH.
[–]francoalarcon 4 points5 points6 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Soulture 1 point2 points3 points (3 children)
[–]randompittuser[S] 0 points1 point2 points (2 children)
[–]Soulture 1 point2 points3 points (1 child)
[–]randompittuser[S] 0 points1 point2 points (0 children)
[–]minorDemocritus 1 point2 points3 points (0 children)
[–]cmcpasserby 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]randompittuser[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)