4

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?

agentofuser
  • 547
  • 3
  • 6
  • 14

2 Answers2

6

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.

Insyte
  • 9,314
  • 2
  • 27
  • 45
  • 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 (http://pypi.python.org/pypi/distribute), but I don't know how to go from here. – agentofuser 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: http://pypi.python.org/pypi/distribute#installation-instructions 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
0

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
nidi
  • 200
  • 1
  • 1
  • 7