尝试导入一个模块:未定义的符号:PyUnicodeUCS4_DecodeUTF8。

时间:2022-11-30 20:17:53

import glib fails with:

进口glib失败:

ImportError: /usr/lib/python2.7/dist-packages/glib/_glib.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8

ImportError:/usr/lib/python2.7/dist-packages / glib / _glib。所以:未定义符号:PyUnicodeUCS4_DecodeUTF8

How can I fix this?

我怎么解决这个问题?

Python version is Python 2.7.3rc2. The OS is Debian.

Python版本是Python 2.7.3rc2。操作系统是Debian。

1 个解决方案

#1


19  

The module was built against a Python that was built with UCS-4 as its internal unicode representation. Your Python was built with UCS-2 as its internal representation. Rebuild the module, or rebuild Python.

该模块构建于使用UCS-4构建的Python的内部unicode表示。您的Python是用UCS-2构建的,作为其内部表示。重建模块,或重新构建Python。

This issue is mentioned in the official FAQ. This is discussed in-depth in python issue 8654.

这个问题在官方的FAQ中被提及。这是在python问题8654中深入讨论的。

#1


19  

The module was built against a Python that was built with UCS-4 as its internal unicode representation. Your Python was built with UCS-2 as its internal representation. Rebuild the module, or rebuild Python.

该模块构建于使用UCS-4构建的Python的内部unicode表示。您的Python是用UCS-2构建的,作为其内部表示。重建模块,或重新构建Python。

This issue is mentioned in the official FAQ. This is discussed in-depth in python issue 8654.

这个问题在官方的FAQ中被提及。这是在python问题8654中深入讨论的。