openwrt上单独安装python-light使用json的问题

来源:互联网 发布:手机淘宝如何取消代付 编辑:程序博客网 时间:2024/06/06 03:04

如果单独安装python-light,就是最基本的python,在import json的时候会出错,说找不到encoding

root@OpenWrt:~# python2.7Python 2.7.9 (default, Jan 27 2016, 17:49:20) [GCC 4.8.3] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import jsonTraceback (most recent call last):  File "<stdin>", line 1, in <module>  File "/usr/lib/python2.7/json/__init__.py", line 108, in <module>    from .decoder import JSONDecoder  File "/usr/lib/python2.7/json/decoder.py", line 24, in <module>    NaN, PosInf, NegInf = _floatconstants()  File "/usr/lib/python2.7/json/decoder.py", line 18, in _floatconstants    _BYTES = '7FF80000000000007FF0000000000000'.decode('hex')LookupError: no codec search functions registered: can't find encoding

是因为没有安装python-codecs,安装上去就没问题了。

0 0