Ask Your Question

Revision history [back]

future import fails in loading external cython file

I wrote a cython file in a text editor, MyProgram.pyx

I opened a new sage notebook, with one line:

load("/home/steve/blahblah/MyProgram.pyx")

When I ran it I got an error message...

Compiling /home/steve/blahblah/MyProgram.pyx...
Error compiling cython file:
Error converting /home/steve/blahblah/MyProgram.pyx to C:

Error compiling Cython file:
------------------------------------------------------------
...

include "cdefs.pxi"
"""
this is my docstring
"""
from __future__ import division
                              ^
------------------------------------------------------------

_home_steve_Dropbox_sharewithlatitude_SteveUnits_pyx_1.pyx:9:31: from
__future__ imports must occur at the beginning of the file

Deleting the docstring -- so that "from __future__ import division" was the very first characters in the file -- did not help. Is this a bug or am I doing something stupid??

I'm using Sage Version 5.0, Release Date: 2012-05-14, on Ubuntu.

future import fails in loading external cython file

I wrote a cython file in a text editor, MyProgram.pyx

I opened a new sage notebook, with one line:

load("/home/steve/blahblah/MyProgram.pyx")

When I ran it I got an error message...

Compiling /home/steve/blahblah/MyProgram.pyx...
Error compiling cython file:
Error converting /home/steve/blahblah/MyProgram.pyx to C:

Error compiling Cython file:
------------------------------------------------------------
...

include "cdefs.pxi"
"""
this is my docstring
"""
from __future__ import division
                              ^
------------------------------------------------------------

_home_steve_Dropbox_sharewithlatitude_SteveUnits_pyx_1.pyx:9:31: _home_steve_blahblah_MyProgram_pyx_1.pyx:9:31: from
__future__ imports must occur at the beginning of the file

Deleting the docstring -- so that "from __future__ import division" was the very first characters in the file -- did not help. Is this a bug or am I doing something stupid??

I'm using Sage Version 5.0, Release Date: 2012-05-14, on Ubuntu.