掘金社区

Python Linux版报错Pinned highlighted

s***g@me.com 发表在掘金2 2016-08-30 08:21:35

掘金2
810
2
0

uname -a

Linux quant.novalocal 3.10.0-327.28.3.el7.x86_64 #1 SMP Thu Aug 18 19:05:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

python ma.py

Traceback (most recent call last):
File "ma.py", line 9, in <module>
from gmsdk import *
File "/usr/local/lib/python2.7/site-packages/gmsdk/init.py", line 11, in <module>
from api import md, td, StrategyBase, get_strerror, get_version, set_timeout_val, get_timeout_val
File "/usr/local/lib/python2.7/site-packages/gmsdk/api.py", line 18, in <module>
from gm import *
ImportError: /usr/local/lib/python2.7/site-packages/gmsdk/gm.so: undefined symbol: PyUnicodeUCS4_FromEncodedObject

是我的内核版本过高吗?还是有什么依赖包需要装?</module></module></module>

评论: 2
  • 找到原因了,编译python时应该使用--enable-unicode=ucs4,否则会报错PyUnicodeUCS4_FromEncodedObject未定义错误。

    When built with --enable-unicode=ucs4:

    &gt;&gt;&gt; import sys
    &gt;&gt;&gt; print sys.maxunicode
    1114111
    

    When built with --enable-unicode=ucs2:

    &gt;&gt;&gt; import sys
    &gt;&gt;&gt; print sys.maxunicode
    65535
    2016-08-30 08:39:22
  • 一般用发行版自带的python就好了

    2016-09-05 07:34:01

Looks like your connection to 掘金量化社区 - 量化交易者的策略交流学习社区 was lost, please wait while we try to reconnect.