Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to easy_install a Python 2.5 package, but I've also got Python 3.1 installed, so I get a syntax error:

except pkg_resources.VersionConflict, e:                                    
SyntaxError: invalid syntax

How do I tell easy_install I want it to install (ReviewBoard, in this case) with Python 2.5?

share|improve this question
up vote 6 down vote accepted

The easy_install code installs the packages for whichever version of Python is being used to run it. It sounds like your system default version of Python is 3.1, so something like this should make it work the way you want:

/path/to/python2.5 /path/to/easy_install ReviewBoard

Worst case you can edit the easy_install script and change the shebang to point to your 2.5 binary.

share|improve this answer
Weirdly enough, there are scripts for easy_install-2.6 and easy_install-3.1, but none for 2.5, although it's installed (Gentoo). Only changing the shebang didn't work, because there's a from pkg_resources import load_entry_point and it gives me an ImportError: No module named pkg_resources. The script uses distribute-0.6.4 (, but I don't know how to go from here. – obvio171 Oct 14 '09 at 15:41
I believe Distribute is backwards compatible, so what I think you're missing is setuptools for your 2.5 install. Alternatively, you could install Distribute for 2.5. Basically follow the directions here: but use "python2.5" wherever it calls for "python". – Insyte Oct 14 '09 at 20:32
Assuming your Python 2.5 binary is called "python2.5", of course. – Insyte Oct 14 '09 at 20:33

Python 2.6 recently became stable on Gentoo, and it looks like it's installed as you're having an easy_install-2.6 script - so it might be that some things got mixed up. That's what I'd do:

In case you're willing to update to python-2.6 (at some point you'll have to):

  • install python 2.6
  • use eselect python to select the right version
  • run python-updater something alike: python-updater -o 2.5 -- -av

In case you want to stay with 2.5:

Try to clean up your installation:

  • Use eselect python to make sure 2.5 is selected
  • Re-merge dev-python/setuptools
  • Eventually run revdep-rebuild -- -a to clean things up
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.