Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

linux - python : undefined symbol: PyUnicodeUCS2_DecodeUTF8

I get a problem when I try to exec 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

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

Thank.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You are using a different Python interpreter for running your code than the one used to compile scipy. This usually occurs with a Python installation compiled with Unicode UCS2 support running modules compiled against a Python installation with Unicode UCS4 support (or vis versa). You need to recompile/reinstall the scipy installation with exact the Python interpreter used for running your code.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...