[Numpy-discussion] numpy1.04b4: undefined symbol: PyUnicodeUCS2_FromUnicode. error No _WIN32

rex rex at nosyntax.com
Mon Aug 28 16:52:49 EDT 2006


Travis Oliphant <oliphant.travis at ieee.org> [2006-08-28 12:42]:
> rex wrote:
> > ImportError: /usr/lib/python2.4/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_FromUnicode
> >
> >
> >   
> 
> This error usually means that NumPy was built and linked against a 
> Python build where unicode strings were 2-bytes per character but you 
> are trying to import it on a Python build where unicode strings are 
> 4-bytes per character.   Perhaps you have changed your build of Python 
> and did not remove the build directory of NumPy.
> 
> Try
> 
> rm -fr build
> 
> in the numpy directory (where you run setup.py) and build again.

Ah! THANK YOU! 

Python 2.4.2 (#1, May  2 2006, 08:13:46)
[GCC 4.1.0 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.test()
  Found 5 tests for numpy.distutils.misc_util
  Found 3 tests for numpy.lib.getlimits
  Found 31 tests for numpy.core.numerictypes
  Found 32 tests for numpy.linalg
  Found 13 tests for numpy.core.umath
  Found 4 tests for numpy.core.scalarmath
  Found 8 tests for numpy.lib.arraysetops
  Found 42 tests for numpy.lib.type_check
  Found 155 tests for numpy.core.multiarray
  Found 3 tests for numpy.fft.helper
  Found 36 tests for numpy.core.ma
  Found 10 tests for numpy.lib.twodim_base
  Found 10 tests for numpy.core.defmatrix
  Found 1 tests for numpy.lib.ufunclike
  Found 4 tests for numpy.ctypeslib
  Found 39 tests for numpy.lib.function_base
  Found 1 tests for numpy.lib.polynomial
  Found 8 tests for numpy.core.records
  Found 26 tests for numpy.core.numeric
  Found 4 tests for numpy.lib.index_tricks
  Found 46 tests for numpy.lib.shape_base
  Found 0 tests for __main__

----------------------------------------------------------------------
Ran 481 tests in 1.956s

OK

Now on to doing it again with MKL...
>From the numpy directory:
rm -fr build
cp site_mkl.cfg site.cfg

where site_mkl.cfg is:
-----------------------------------------------------------------------
[DEFAULT]
library_dirs=/opt/intel/mkl/8.1/lib/32
include_dirs=/opt/intel/mkl/8.1/include

[blas_opt]
libraries=libmkl.so,libmkl_p3.so,libmkl_vml_p3.so,libmkl_ia32.a,libguide.so,libmkl_def.so
#libraries=whatever_the_mkl_blas_lib_is,mkl_ia32,mkl,guide

[lapack_opt]
libraries=libmkl_lapack32.so,libmkl_lapack.a,
#libraries=mkl_lapack,mkl_lapack32,mkl_ia32,mkl,guide
----------------------------------------------------------------------
python setup.py install >& inst.log

Looks OK, so in another window:

python
Python 2.4.2 (#1, May  2 2006, 08:13:46)
[GCC 4.1.0 (SUSE Linux)] on linux2
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/numpy/__init__.py", line 39, in ?
    import linalg
  File "/usr/lib/python2.4/site-packages/numpy/linalg/__init__.py", line 4, in ?
    from linalg import *
  File "/usr/lib/python2.4/site-packages/numpy/linalg/linalg.py", line 25, in ?
    from numpy.linalg import lapack_lite
ImportError: libmkl_lapack32.so: cannot open shared object file: No such file or directory
>>>

Oops!

^d

export INCLUDE=/opt/intel/mkl/8.1/include:$INCLUDE
export LD_LIBRARY_PATH=/opt/intel/mkl/8.1/lib/32:$LD_LIBRARY_PATH
python
Python 2.4.2 (#1, May  2 2006, 08:13:46)
[GCC 4.1.0 (SUSE Linux)] on linux2
>>> import numpy
>>> numpy.test()
  Found 5 tests for numpy.distutils.misc_util
  Found 3 tests for numpy.lib.getlimits
  Found 31 tests for numpy.core.numerictypes
  Found 32 tests for numpy.linalg
  Found 13 tests for numpy.core.umath
  Found 4 tests for numpy.core.scalarmath
  Found 8 tests for numpy.lib.arraysetops
  Found 42 tests for numpy.lib.type_check
  Found 155 tests for numpy.core.multiarray
  Found 3 tests for numpy.fft.helper
  Found 36 tests for numpy.core.ma
  Found 10 tests for numpy.lib.twodim_base
  Found 10 tests for numpy.core.defmatrix
  Found 1 tests for numpy.lib.ufunclike
  Found 4 tests for numpy.ctypeslib
  Found 39 tests for numpy.lib.function_base
  Found 1 tests for numpy.lib.polynomial
  Found 8 tests for numpy.core.records
  Found 26 tests for numpy.core.numeric
  Found 4 tests for numpy.lib.index_tricks
  Found 46 tests for numpy.lib.shape_base
  Found 0 tests for __main__

----------------------------------------------------------------------
Ran 481 tests in 2.152s

OK

Now off to build SciPy.

Thanks again!

-rex




More information about the NumPy-Discussion mailing list