No Module Named Pyinstaller
- Pyinstaller No Module Named Sip
- Pyinstaller No Module Named _gdal
- Importerror: No Module Named Tkinter
Pyinstaller: ImportError: No module named pefile. 2016-06-19 pyinstalle pefile. Pyinstaller 打包时出现No Module Named pkg_resources. 2015-08-11 pyinstaller.
I am trying to package my application with pyinstaller. But when executing the .exe file I get the following errors:
Pyinstaller No Module Named Sip
Traceback (most recent call last):
File 'site-packagesmdfreader_init_.py', line 28, in
File 'c:pythonpython36libsite-packagesPyInstallerloaderpyimod03_importers.py', line 631, in exec_module
exec(bytecode, module.dict)
File 'site-packagesmdfreadermdfreader.py', line 48, in
ModuleNotFoundError: No module named 'mdf3reader'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File 'drivers_notes.py', line 8, in
from mdfreader import mdf
File 'c:pythonpython36libsite-packagesPyInstallerloaderpyimod03_importers.py', line 631, in exec_module
exec(bytecode, module.dict)
File 'site-packagesmdfreader_init_.py', line 30, in
ImportError: cannot import name 'mdfinfo'
[5568] Failed to execute script drivers_notes
I have been trying via the pyinstaller support pages to find a way to solve this but I am just too much of a newbie when it comes to python, modules and dependencies. Giving it one last try here in case anyone else has any experience with mdfreader and pyinstaller.
Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHave 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
Comments
commented Jan 12, 2018
An ImportError occurs at runtime after bundling an application using the pyttsx3 library. The error occurs when the text-to-voice engine is initialized, not when the library is imported: PyInstaller builds the executable without any issue and as such, the log file is empty. Platform details: Here is a link to a gist containing the steps to reproduce, a sample program, the spec file and the stack trace: https://gist.github.com/AlexPicaro/aac977ead73c48a1e8e0d0d35f1a4cab |
commented Feb 1, 2018 • edited
edited
Pyinstaller doesn't bundle everything it should when compiling the file. Pyttsx has hooks setup for it and was fixed. Pyttsx3 was created to support Python 3.X, I would recommend using pyttsx, if you're using Python 2.X. I've been banging my head on this problem for a couple of months or so. I just haven't had the hours to devote to it to track it all down. |
commented Feb 7, 2018
I see that you're already collecting the submodules, so that's not the issue. It seems that your issue here, is directly related to the issue I was having. I fixed it by creating a new hook-pyttsx3.py file which essentially does the same thing as your collect_submodules statement in your spec file. Then, I also commented out all lines in the pyi_rth_win32comgenpy.py file. Should be located in the rthooks folder. C:UsersYourUserNameAppDataLocalProgramsPythonYourPythonFolderLibsite-packagesPyinstallerloaderrthooks I'm guessing the pyi_rth_win32comgenpy.py hook is messing up something for you too. |
commented Feb 8, 2018
Hey sorry I didn't respond to your first comment! The message got lost in my inbox. I tried that last solution you posted, and that solved my problem. Thanks a bunch! I'm still having issues though, so I'll try pyttsx instead. |
commented Feb 9, 2018
What issue are you having? |
commented Feb 10, 2018
Different import error, but I really don't know what to make of this one. Here's the stack trace: |
commented Feb 12, 2018
Did you try commenting out all of the lines in the file pyi_rth_win32comgenpy.py file commented out: |
commented Feb 12, 2018
I did. |
commented Feb 13, 2018
Try uncommenting these two lines in the pyi_rth_win32comgenpy.py file: |
commented Feb 14, 2018
I get the same stack trace as before. |
commented Feb 16, 2018 • edited
edited
I noticed in your gist, that you have wine settings setup in your spec file. You may be having issues with wine + pyinstaller. Python 2.7 + pyttsx3 + Win10 + Pyinstaller works with the pyttsx3 hook. The pyi_rth_win32comgenpy.py file doesn't seem to have any effect on Python 2.7 + pyttsx3. Uncommented or commented out, a pyttsx3 test doesn't throw any errors when compiled with pyinstaller. The pyi_rth_win32comgenpy.py file breaks a simple command line example with Python 3.4 or Python 3.6 + pyttsx3. Creating a check to see, if the python version is >= 3.0 to skip everything in the file for a Python 3.X install works for me. It seems that at least something in the pyi_rth_win32comgenpy.py file helps with your Python2.X + pyttsx3 + wine build, but there's still something more that's not working right. |
referenced this issue Feb 19, 2018
Openfixed / workaround for pyttsx3 test won't work once compiled with pyinstaller #3268
commented Jan 7, 2019
No reaction for several months, assume this is solved. Otherwise please try PyInstaller v3.4 and the current development version. |
commented Jan 20, 2019 • edited
edited
Pyinstaller No Module Named _gdal
Not solve it yet... |