Philipp Zedler
Philipp Zedler

Reputation: 1670

python2.5 packages in virtualenv contain too new syntax for python2.5

I've created a virtualenv that uses python2.5 instead of my default version python2.6 by executing this command:

virtualenv -p /usr/bin/python2.5 myvirtualenv --no-site-packages

Now, when I want to install packages in the virtualenv using pip, I get syntax errors like this one:

File "/home/philipp/.virtualenvs/myvirtualenv/lib/python2.5/site-packages/pip-1.4.1-py2.5.egg/pip/vendor/distlib/compat.py", line 276
    return b''
             ^
SyntaxError: invalid syntax

That means that my python2.5 packages contain syntax that is not yet valid in python2.5. When I use pip-2.5 this will not change anything. There should be two possibilities to get around this problem:

  1. Somehow tell pip that it should accept the newer syntax
  2. Find the misconfiguration of the virtualenv program and repair it.

I'm happy about any ideas about how to proceed.

Upvotes: 2

Views: 216

Answers (2)

doomrobo
doomrobo

Reputation: 88

pip versions 1.4.1+ no longer support Python 2.5. I recommend you install an older version of pip (1.3.1 will do) or use a more recent version of Python2 (2.6 will do).

Source: http://www.pip-installer.org/en/latest/installing.html

Upvotes: 1

Martijn Pieters
Martijn Pieters

Reputation: 1121834

Pip version 1.4 requires Python 2.6 or newer.

You'll need to install Pip version 1.3.1 if you want it to work on Python 2.5, see Python & OS Support.

Upvotes: 4

Related Questions