[Tutor] Building Python 2.7.3 on RHEL 5.8 x86_64 -- Syntax Error

Hugo Arts hugo.yoshi at gmail.com
Tue Mar 26 17:54:15 CET 2013


On Tue, Mar 26, 2013 at 3:18 PM, Sean Carolan <scarolan at gmail.com> wrote:

>
>  Could it be that it is taking the system python executable which is
>> probably 2.4?
>>
>> -Amit.
>
>
> I've tried it with python24, python25 and python27 and all of them give
> the same error.
>
>
What it looks like to me is that while you run (using python 2.7):

>  python27 setup.py bdist_rpm

doing that generates a temporary bash script, which in turn runs:

> python setup.py build

which is linked to the system default python, which I'm guessing is 2.4. No
matter which version you execute the first one with, the bash script
generated will always try to use the system-default python. This is
essentially a bug in the setup script; it should generate a script that
uses the same python version it was executed with, ideally.

The easiest workaround I can think of is a temporary alias, i.e.:

$ alias python="python27" && python setup.by bdist_rpm && unalias python

Or some variation of such. The more permanent fix is to change the bash
script that setup.py generates so it's less naive about having the right
system python installed, *or* upgrading the system python version.

HTH,
Hugo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130326/9b378bca/attachment.html>


More information about the Tutor mailing list