IronPython “LookupError: unknown encoding: hex”

匿名 (未验证) 提交于 2019-12-03 03:09:01

问题:

When I try to "import simplejson" (or something that depends on it) in IronPython 2.0, I get "LookupError: unknown encoding: hex". How do I make this work?

回答1:

The workaround for this is to import the hex codec manually before attempting to import the broken dependency:

from encodings import hex_codec 

The issue is being tracked by IronPython, but so far, they claim it's a bug in the standard Python library.



回答2:

Thanks, sblom. I think IronPython crew are right in saying its a bug in the standard library (or at least Freeze tool as of 2.7). Problem occurs with "frozen" programs iffrom encodings import hex_codec is not explicitly written in the script.

Sorry to 'necro-post', but this issue I feel was relevant, at least in regard to the Freeze tool.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!