简体   繁体   中英

PyInstaller - No module named 'codecs'

My script literally looks like this (Python 3.5):

print("Hello world")

Building it with PyInstaller (version 3.5 I guess?) ( pyinstaller --onefile test.py or even pyinstaller test.py ) results in an error:

Fatal Python error: Py_Initialize: unable to load the file system codec
Traceback (most recent call last):
  File "encodings\__init__.py", line 31, in (module)
ImportError: No module named 'codecs'.

I'm kinda new to Python, so I don't know what could be causing the problem nor do I know how to fix it. Any ideas?

What version of PyInstaller are you using? I think there might be a bug on older versions that could cause this error.

Try running "pip install --upgrade pyinstaller".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM