[Numpy-discussion] Python 3 porting

Bruce Southey bsouthey at gmail.com
Mon Feb 15 11:18:59 EST 2010


On 02/15/2010 12:55 AM, Pauli Virtanen wrote:
> ma, 2010-02-15 kello 00:38 +0100, Xavier Gnata kirjoitti:
>    
>> Ok!
>> git clone git://github.com/pv/numpy-work.git
>> git checkout origin/py3k
>> NPY_SEPARATE_BUILD=1 python3.1 setup.py build
>>
>> but now it fails during the build:
>>
>> In file included from numpy/core/src/multiarray/buffer.c:14,
>> from numpy/core/src/multiarray/multiarraymodule_onefile.c:36:
>> numpy/core/src/multiarray/buffer.h: At top level:
>> numpy/core/src/multiarray/buffer.h:14: error: conflicting types for
>> ‘_descriptor_from_pep3118_format’
>> numpy/core/src/multiarray/common.c:220: note: previous implicit
>> declaration of ‘_descriptor_from_pep3118_format’ was here
>> In file included from
>> numpy/core/src/multiarray/multiarraymodule_onefile.c:36:
>> numpy/core/src/multiarray/buffer.c: In function ‘_buffer_format_string’:
>> numpy/core/src/multiarray/buffer.c:151: warning: unused variable ‘repr’
>>      
> Hmm, I probably tested only the separate compilation properly as it
> seems the single-file build is failing. The environment variable is
> actually NPY_SEPARATE_COMPILATION=1, not *_BUILD.
>
>    
Hi,
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.

I tried appending the directory with sys.path but that did not work.

Python 3.1.1 (r311:74480, Feb 15 2010, 09:08:21)
[GCC 4.4.1 20090725 (Red Hat 4.4.1-2)] on linux2


 >>> import numpy
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python3.1/site-packages/numpy/__init__.py", line 
136, in <module>
     from . import add_newdocs
   File "/usr/local/lib/python3.1/site-packages/numpy/add_newdocs.py", 
line 9, in <module>
     from numpy.lib import add_newdoc
   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

Thanks
Bruce



More information about the NumPy-Discussion mailing list