[Numpy-discussion] Python 3 porting

Pauli Virtanen pav@iki...
Mon Feb 15 10:55:18 CST 2010

ma, 2010-02-15 kello 10:18 -0600, Bruce Southey kirjoitti:
> Is there a correct way to get Python3.1 to find the relative path on Linux?
> I can change the import statement to work but I do not think that is viable.

You need to use relative imports. 2to3 should be able to take care of

>    File "/usr/local/lib/python3.1/site-packages/numpy/lib/__init__.py", 
> line 1, in <module>
>      from info import __doc__
> ImportError: No module named info

That statement should read

	from .info import __doc__

and indeed, it reads like that for me. Check how it is in

Most likely you interrupted the build by Ctrl+C and 2to3 did not finish
the conversion of the files to Python3 format. Try removing the build/
directory and trying again -- if you interrupt it, 2to3 may not have
finished running.

Of course, it should be more robust, but at the moment, it isn't
(patches welcome).

Pauli Virtanen

More information about the NumPy-Discussion mailing list