蟒蛇:未定义的符号:PyUnicodeUCS2_DecodeUTF8(python : undefi

2019-09-21 02:03发布

我得到一个问题,当我试图给exec我的主文件在python(我是在Ubuntu 12.04使用Python 2.7)。 我得到这个错误:

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的安装与Python包管理器 (见我以前的帖子在这里: 蟒蛇:SciPy的Ubuntu上安装 。

谢谢。

Answer 1:

您使用的是不同的Python解释器来运行你的代码不是用来编译SciPy的一个。 这通常与使用Unicode UCS2支持运行针对一个Python安装使用Unicode UCS4支持(或可见反之亦然)编译的模块编译一个Python安装发生。 你需要重新编译/重新安装SciPy的安装与使用完全运行代码的Python解释器。



文章来源: python : undefined symbol: PyUnicodeUCS2_DecodeUTF8