New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyInstaller - No module named 'codecs' - Windows 7 #5730
Comments
Is that a build-time or a run-time error? |
The embedded Python builds aren't supported yet. See #4989. |
It's a run-time error. I have build successfully since there is a hello.exe in dist dir. When I run hello.exe, it outputs this error. |
Did you explicitly work around the missing support for collecting files from embedded |
Thanks very much for your prompt response. Now it proceeds to a run-time error:) Is it possible to figure it out why? Alternatively I will then try the python-X.exe. |
Ah, that's a clever trick. :)
Looks like PyInstaller does not construct I'll check what's going on with base library generation... |
Looks like our pyinstaller/PyInstaller/depend/utils.py Line 77 in 7d77825
Can you try modifying this file in your local PyInstaller installation, by adding |
Haha, I am a little confused.
Do you mean after changing the follow sentence
*if type(mod) in (modulegraph.SourceModule, modulegraph.Package):*
to
*if type(mod) in (modulegraph.SourceModule,
modulegraph.Package, modulegraph.CompiledModule):*
, then it might solve the problem of my current run-time "no module named
codecs" error?
Thanks,
…On Tue, Apr 13, 2021 at 8:08 PM Rok Mandeljc ***@***.***> wrote:
Looks like our create_py3_base_library implementation is ignoring
compiled modules:
https://github.com/pyinstaller/pyinstaller/blob/7d77825f42a5929d08b3337fd7b4550bc5387f42/PyInstaller/depend/utils.py#L77
Can you try modifying this file in your local PyInstaller installation, by
adding modulegraph.CompiledModule to the above list? Since you're using
python 3.6, that might do the trick without additional modifications...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5730 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIDYBECA6MYR5RJJA4HZG33TIQX47ANCNFSM4224YBXA>
.
--
--------------------------------------------
Qian Feng, PhD Student
Melbourne Integrative Genomics (MIG)
School of Mathematics and Statistics
University of Melbourne
E-mail: ***@***.***
Phone: +61 (0)4526 01685
URL: https://qianfeng2.github.io
|
Yes, open if type(mod) in (modulegraph.SourceModule, modulegraph.Package, modulegraph.CompiledModule): and try rebuilding your application. This time around, |
There's more broken in embedded Python than just that. There's several places where PyInstaller skips searching modules because it can't find them in the zipped |
That's true, but as per article linked in #5730 (comment), you can avoid zip-related issues by simply renaming the |
Haha!!! It works!!! Now, my first hello.exe works very good!!! That's magic! I have spent two weeks struggling to solve this codecs issue. |
Dear whom it may concern,
My script literally looks like this (Python 3.6.7-embed-win32):
print("Hello world")
Building it with PyInstaller (version 5.0.dev.0) (pyinstaller --onefile hello.py or even pyinstaller hello.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'.
Is there anything I can do on my window 7 computer?
Thanks in advance.
The text was updated successfully, but these errors were encountered: