python2声明utf8_python:未定义的符号: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

sys.exit(main())

File "__main__.py", line 5, in main

import launch

File "/home/michael/rubyWorkSpace/pymcs/launch.py", line 2, in

import src.lib.utils as fn

File "/home/michael/rubyWorkSpace/pymcs/src/lib/utils.py", line 4, in

import scipy.signal, numdisplay, sys

File "/home/michael/.local/lib/python2.7/site-packages/scipy/signal/__init__.py", line 200, in

from bsplines import *

File "/home/michael/.local/lib/python2.7/site-packages/scipy/signal/bsplines.py", line 2, in

import scipy.special

File "/home/michael/.local/lib/python2.7/site-packages/scipy/special/__init__.py", line 527, in

from basic import *

File "/home/michael/.local/lib/python2.7/site-packages/scipy/special/basic.py", line 12, in

import orthogonal

File "/home/michael/.local/lib/python2.7/site-packages/scipy/special/orthogonal.py", line 697, in

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.

解决方案

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值