#3 from __future__ imports must be at the beginning

open
nobody
None
5
2008-09-16
2008-09-16
JJ Geewax
No

I tried installing SOAPpy and had to move a few imports around to get Python 2.5 not to complain.

The following files had from __future__ imports that were not at the top of the import list:

SOAPpy/
Server.py
Types.py
Client.py

Moving those imports up let the distools install work just fine.

Thanks for all your hard work!

Discussion

  • Joe Stump
    Joe Stump
    2010-02-10

    I'm getting the same problem on OS X 10.6.2 using Python 2.6.1. Here's the full output:

    simplegeo:SOAPpy-0.12.0 jstump$ sudo python setup.py install
    Traceback (most recent call last):
    File "setup.py", line 8, in <module>
    from SOAPpy.version import __version__
    File "/Users/jstump/Downloads/SOAPpy-0.12.0/SOAPpy/__init__.py", line 5, in <module>
    from Client import *
    File "/Users/jstump/Downloads/SOAPpy-0.12.0/SOAPpy/Client.py", line 46
    from __future__ import nested_scopes
    SyntaxError: from __future__ imports must occur at the beginning of the file
    simplegeo:SOAPpy-0.12.0 jstump$ python --version
    Python 2.6.1
    simplegeo:SOAPpy-0.12.0 jstump$ uname -a
    Darwin simplegeo.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386