質問

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.

役に立ちましたか?

解決

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.

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top