[LSST|dm-users 530] Re: Install error in eups with Python 3

John Swinbank swinbank at princeton.edu
Mon Dec 29 12:03:47 PST 2014


Hello,

> On 29 Dec 2014, at 19:09, Christoph Deil <Deil.Christoph at gmail.com> wrote:
> 
> Here’s the eupsbuild.log file … I didn’t try to figure out the problem, but there are errors because somewhere print statement are used that don’t work on Python 3:
> https://gist.github.com/cdeil/85096e28b0692fdd9c60#file-gistfile1-txt-L187

I can confirm the issue.

The problem arises when running ./configure in EUPS. Even when a Python 2.7 interpreter (eg /usr/bin/python on a Mac) is specified to —with-python, configure still relies on /usr/bin/env to select an appropriate Python to run mksetup. Thus:

  $ /usr/bin/python --version
  Python 2.7.6
  
  $ ./configure --with-python=/usr/bin/python
  config.status: creating ups/eups.table
  File "./mksetup", line 37
    print "Writing a csh startup script";
                                       ^
  SyntaxError: Missing parentheses in call to ‘print'

As a workaround, you should just be able to drop /opt/local/bin from your path while newinstall.sh runs, then reinstate it afterwards. (If that’s not possible — because you need other things in that directory, say — “sudo port select python python27-apple” will do the trick.)

After installation, everything should be fine since the configure script re-writes the eups executable to point to an appropriate Python interpreter.

As a longer term solution, I ran 2to3 on mksetup then added a “from __future__ import print_function”, and can now install EUPS with both Python 2.7 & 3.4. I can’t decide if that’s the right solution, or if it would be better to force the —with-python option to also apply to mksetup. Thoughts?

Cheers,

John


More information about the dm-users mailing list