를 가져올 수 없습니다 :나 cx_Freeze 다음 파이썬 스크립트는 잘 실행 JSONDecoder를
#!/usr/bin/python
import simplejson
print str(simplejson.loads('{"a": "abc"}'))
그 다음 동결 후 :이 도움이되지 것
cxfreeze test.py --target-dir dist
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/cx_Freeze/initscripts/Console.py", line 29, in <module>
exec code in m.__dict__
File "test.py", line 3, in <module>
import simplejson as json
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 111, in <module>
from decoder import JSONDecoder, JSONDecodeError
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 29, in <module>
NaN, PosInf, NegInf = _floatconstants()
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 21, in _floatconstants
_BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
LookupError: unknown encoding: hex
:
cxfreeze test.py --target-dir dist --include-modules simplejson
그리고도 simplejson에서 json으로 전환했습니다.
P simplejson /usr/lib/python2.7/dist-packages/simplejson/__init__.py
m simplejson._speedups /usr/lib/python2.7/dist-packages/simplejson/_speedups.so
m simplejson.decoder /usr/lib/python2.7/dist-packages/simplejson/decoder.py
m simplejson.encoder /usr/lib/python2.7/dist-packages/simplejson/encoder.py
m simplejson.ordered_dict /usr/lib/python2.7/dist-packages/simplejson/ordered_dict.py
m simplejson.scanner /usr/lib/python2.7/dist-packages/simplejson/scanner.py
'encodings.hex_codec' 모듈을 포함해야합니다. 이 문제를 자동으로 해결하기 위해 [문제] (https://bitbucket.org/anthony_tuininga/cx_freeze/issue/17/hooks-python-2-json-simplejson-dynamically)를 열었습니다. –
"대답"에 넣으면 받아 들일 것입니다. 이제 실행됩니다. 예외 : 예외 KeyError : 'module'threading 'from'/dist/test/threading.pyc '>의 KeyError (140052806182656)가 무시되었습니다. –
방금 복제하려고 시도했지만 할 수 없었습니다. 나는 파이썬 설치와 다른 점이 무엇인지 모르겠습니다. (우분투에서 2.6.8과 2.7.3으로 시도했습니다.) –