ralfonso/theory — pull request #8 by jkliff (2012-05-05 13:58:35+00:00)
Title: Force python 2.6 on install (compatibility with 2.7 is an issue in virtualenv)

Please consider the following fix for the issue described below:

On a clean clone, ./install fails as follows.

% ./install.sh
installing theory prerequisites and Python virtual environment to /home/john/Desktop/src/theory//env/
New python executable in /home/john/Desktop/src/theory//env/bin/python
Traceback (most recent call last):
File "/home/john/Desktop/src/theory//env/lib/python2.7/site.py", line 67, in
import os
File "/home/john/Desktop/src/theory//env/lib/python2.7/os.py", line 398, in
import UserDict
File "/home/john/Desktop/src/theory//env/lib/python2.7/UserDict.py", line 83, in
import _abcoll
File "/home/john/Desktop/src/theory//env/lib/python2.7/_abcoll.py", line 11, in
from abc import ABCMeta, abstractmethod
File "/home/john/Desktop/src/theory//env/lib/python2.7/abc.py", line 8, in
from _weakrefset import WeakSet
ImportError: No module named _weakrefset
ERROR: The executable /home/john/Desktop/src/theory//env/bin/python is not functioning
ERROR: It thinks sys.prefix is '/home/john/Desktop/src/theory' (should be '/home/john/Desktop/src/theory/env')
ERROR: virtualenv is not compatible with this system or executable

--

Narrowing it down, the issue lies in a bug on virtual env (https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/662611) in which runnig it from py2.7 is the culprit.
Case in point, on my system python 2.7 is indeed the default one.

The issue is easily solved forcing the python which executes go-pylons to be 2.6.

Probably this should check more resiliently for the version of the python executable on different environments, but as far as it goes with typical aliasing of python versions (python2.5, python2.6, etc), this works properly.