Python: undefined character: PyUnicodeUCS2_DecodeUTF8

I get a problem when I try to execute my main file in python (I'm on Ubuntu 12.04 with python 2.7). I get this error:

michael@michael-laptop-ubuntu :~/rubyWorkSpace/pymcs$ python __main__.py Traceback (most recent call last): File "__main__.py", line 9, in <module> sys.exit(main()) File "__main__.py", line 5, in main import launch File "/home/michael/rubyWorkSpace/pymcs/launch.py", line 2, in <module> import src.lib.utils as fn File "/home/michael/rubyWorkSpace/pymcs/src/lib/utils.py", line 4, in <module> import scipy.signal, numdisplay, sys File "/home/michael/.local/lib/python2.7/site-packages/scipy/signal/__init__.py", line 200, in <module> from bsplines import * File "/home/michael/.local/lib/python2.7/site-packages/scipy/signal/bsplines.py", line 2, in <module> import scipy.special File "/home/michael/.local/lib/python2.7/site-packages/scipy/special/__init__.py", line 527, in <module> from basic import * File "/home/michael/.local/lib/python2.7/site-packages/scipy/special/basic.py", line 12, in <module> import orthogonal File "/home/michael/.local/lib/python2.7/site-packages/scipy/special/orthogonal.py", line 697, in <module> from orthogonal_eval import \ ImportError: /home/michael/.local/lib/python2.7/site-packages/scipy/special/orthogonal_eval.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8 

Scipy is currently installed with the Python Package Manager (see my previous post here: python: scipy install on ubuntu .

Thanks.

+4
source share
1 answer

You use a different Python interpreter to run your code than the one used to compile scipy. This usually happens with a Python installation compiled with Unicode UCS2 support, using modules compiled with a Python installation with Unicode UCS4 support (or vice versa). You need to recompile / reinstall the scipy program using the exact Python interpreter used to run your code.

+7
source

All Articles