Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_AsASCIIString

When I run django project, I came across a strange problem as listed:

ImportError: /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_AsASCIIString

If I I run this project in dev mode(python manage.py runserver 0.0.0.0:8000), it doesn't occur. But when I deploy this project in apache and then this problem occurs.

In this project, I use nltk package and mongodb, and numpy is a dependency. My OS is CentOS 6.3 and I upgraded python from 2.6.6 to 2.7.3 which is compiled by myself.

Following some instructions, I recompile and rebuild python with ./configure --enable-unicode=ucs2. But that seems didn't work.

So any guys know the reason or solutions? Thanks a lot!

like image 964
skymoney Avatar asked Jul 03 '13 08:07

skymoney


1 Answers

Rebuild NumPy against a Python built as UCS-4.

like image 195
Ignacio Vazquez-Abrams Avatar answered Feb 06 '23 23:02

Ignacio Vazquez-Abrams