python:未定义的符号:PyUnicodeUCS2_DecodeUTF8

当我尝试在python中执行我的主文件时遇到问题(我在使用python 2.7的Ubuntu 12.04上)。我收到此错误:

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的Python解释器不同的Python解释器来运行代码。这通常发生在使用Unicode

UCS2支持编译的Python安装程序,运行针对使用UnicodeUCS4支持的Python安装程序编译的模块时(反之亦然)。您需要使用用于运行代码的精确Python解释器重新编译/重新安装scipy安装。

以上是 python:未定义的符号:PyUnicodeUCS2_DecodeUTF8 的全部内容, 来源链接: utcz.com/qa/420493.html

回到顶部