Problem packaging with PyInstaller

Heads up! You've already completed this tutorial.

LeticiaF | 2020-05-07 19:07:26 UTC | #1

Hi, thank you so much for this tutorial, but I'm having a problem when opening the .exe, appears this message: ModuleNotFoundError: No module named 'PyQt5' [43227] Failed to execute script. What I'm doing wrong? Thank you for your attention!!


doev | 2020-07-17 08:17:22 UTC | #2

I have exactly the same error. Any news?


martin | 2020-07-19 10:30:49 UTC | #3

Hey @doev are you able to share your PyInstaller .spec file or the source file you're packaging. Also which version of Python & PyQt5 are you using?

It suggests that PyInstaller isn't discovering that your application using PyQt5 for some reason. Once we figure out where it's going wrong we should be able to fix it.

Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.

More info Get the book


doev | 2020-07-20 14:27:49 UTC | #4

Hello Martin,

Over 10,000 developers have bought Create GUI Applications with Python & Qt!
Create GUI Applications with Python & Qt6
Take a look

Downloadable ebook (PDF, ePub) & Complete Source code

Also available from Leanpub and Amazon Paperback

[[ discount.discount_pc ]]% OFF for the next [[ discount.duration ]] [[discount.description ]] with the code [[ discount.coupon_code ]]

Purchasing Power Parity

Developers in [[ country ]] get [[ discount.discount_pc ]]% OFF on all books & courses with code [[ discount.coupon_code ]]

thank you for your reply. After I switched from anaconda to pip, your code is working well. I have still about 30 warings on missing modules, but I think that is a problem of PyInstaller.


PyQt/PySide 1:1 Coaching with Martin Fitzpatrick — Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.

Book Now 60 mins ($195)

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak
Martin Fitzpatrick

Problem packaging with PyInstaller was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt. Martin founded PythonGUIs to provide easy to follow GUI programming tutorials to the Python community. He has written a number of popular https://www.martinfitzpatrick.com/browse/books/ on the subject.