ModuleNotFoundError: No module named 'qtmodern'

Heads up! You've already completed this tutorial.

Scoodood | 2020-08-15 00:53:22 UTC | #1

Hi @martin, I was trying to run the sample code themes\modern.py but I get the following error:

python
import qtmodern.styles
import qtmodern.windows
...

ModuleNotFoundError: No module named 'qtmodern'

I believe the file qtmodern.py is missing.

Best Regard


martin | 2020-08-16 14:57:13 UTC | #2

Yep, qtmodern is a separate library you need to install with pip. Just the normal pip install qtmodern should do it.

I'll check the explanation as maybe this isn't made clear enough.

1:1 Coaching & Tutoring for your Python GUIs project
Martin Fitzpatrick Python GUIs Coaching & Training
60 mins ($195) Book Now

1:1 Python GUIs Coaching & Training

Comprehensive code reviewBugfixes & improvements • Maintainability advice and architecture improvements • Design and usability assessment • Suggestions and tips to expand your knowledgePackaging and distribution help for Windows, Mac & Linux • Find out more.


Scoodood | 2020-08-16 03:38:05 UTC | #3

Your ebook didn’t mentioned anything about the qtmodern. But the code is from your zip file, under the theme folder. Most of the code are related to that chapter, and I thought qtmodern Is a file. Now I know it is library. Thanks


martin | 2020-08-16 14:29:17 UTC | #4

Create GUI Applications with Python & Qt6 by Martin Fitzpatrick — (PySide6 Edition) The hands-on guide to making apps with Python — Over 10,000 copies sold!

More info Get the book

The (small) bit about Qt modern is on page 199 under "3rd Party Styles" in the "16. Styles" chapter. There isn't any code shown in the book though.


Scoodood | 2020-08-16 15:01:51 UTC | #5

Thanks @martin, I found it now, it's on page 184 on mine.

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


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

ModuleNotFoundError: No module named 'qtmodern' 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 Python books on the subject.