ImportError: modules/XXX.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

问题:
服务器Linux系统原生python2.7.9, 想升级运行多进程multiprocessing【见此链接】。 想使用Anaconda2安装python2.7.15, 安装完成后,导入编译好的.so文件遇到问题:
ImportError: modules/XXX.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

Google之:
系统原生的python为UCS2编码,Anaconda的 python均为UCS4, .so文件编译时的平台为UCS2
比较相关的答案链接
https://stackoverflow.com/questions/11878666/python-undefined-symbol-pyunicodeucs2-decodeutf8

https://stackoverflow.com/questions/16871799/trying-to-import-a-module-undefined-symbol-pyunicodeucs4-decodeutf8

"on Linux all Anaconda Python packages use UCS4, more precisely: Because Anaconda Python 2 itself was compiled using the UCS4 flag, all (C extension) packages build against it, will be only compatible with a UCS4 Python 2 build. In many Linux distributions, e.g. Ubuntu, CentOS, UCS4 is used by the system Python (/usr/bin/python). You can always check this by looking at sys.maxunicode: the value 1114111 means UCS4 and 65535 means UCS2. It would be a large effort to provide an additional version of Anaconda for Linux in which all packages are build against a UCS2 compiled Python 2. "
https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/CWU07_b1VZY

我的解决方案:
卸载Ananconda, 手动下载并安装Python 2.7.15.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值