Python 2.7 "wide-build" usc4 是否与某些库不兼容?
Is Python 2.7 "wide-build" usc4 not compatible with certain libraries?
我需要能够处理一些具有高值的 unicode 字符,所以我重新安装了 Python 2.7.10 并带有选项 --enable-unicode=ucs4 --prefix
("wide-build")。
然后我开始收到以下错误:
...
from Crypto.Cipher import _ARC4
ImportError: /home/fast/usr/local/lib/python2.7/site-packages/Crypto/Cipher/_ARC4.so: undefined symbol: PyUnicodeUCS2_FromString
我意识到 undefined symbol: PyUnicodeUCS2_FromString
一定是因为新版本,所以我尝试重新安装所有新的东西(新 Python 和新 pip 以及新安装的库)。我仍然有同样的错误。
是否根本不可能将 Crypto
库与 Python wide-build 一起使用?
我找不到这方面的任何文档。有任何已知的解决方法吗?
感谢您的帮助!
Python2 中没有针对此问题的令人满意的解决方案:UCS2 和 UCS4 构建具有不兼容的 ABI,并且需要从源代码构建库(因为大多数二进制蛋是针对默认 UCS2 ABI 构建的). This issue details the problem, and the resolution that made it into Python 3.3 (PEP 393).
不过,您使用 UCS4 版本的理由有点可疑。 Python 的 UCS2 构建完全能够 "work[ing] with some unicode characters with high values",使用代理对来表示补充代码点。
我需要能够处理一些具有高值的 unicode 字符,所以我重新安装了 Python 2.7.10 并带有选项 --enable-unicode=ucs4 --prefix
("wide-build")。
然后我开始收到以下错误:
...
from Crypto.Cipher import _ARC4
ImportError: /home/fast/usr/local/lib/python2.7/site-packages/Crypto/Cipher/_ARC4.so: undefined symbol: PyUnicodeUCS2_FromString
我意识到 undefined symbol: PyUnicodeUCS2_FromString
一定是因为新版本,所以我尝试重新安装所有新的东西(新 Python 和新 pip 以及新安装的库)。我仍然有同样的错误。
是否根本不可能将 Crypto
库与 Python wide-build 一起使用?
我找不到这方面的任何文档。有任何已知的解决方法吗?
感谢您的帮助!
Python2 中没有针对此问题的令人满意的解决方案:UCS2 和 UCS4 构建具有不兼容的 ABI,并且需要从源代码构建库(因为大多数二进制蛋是针对默认 UCS2 ABI 构建的). This issue details the problem, and the resolution that made it into Python 3.3 (PEP 393).
不过,您使用 UCS4 版本的理由有点可疑。 Python 的 UCS2 构建完全能够 "work[ing] with some unicode characters with high values",使用代理对来表示补充代码点。