Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. First Steps in Qt Creator: ModuleNotFoundError: No module named 'PyQt5' - beginners issue
QtWS25 Last Chance

First Steps in Qt Creator: ModuleNotFoundError: No module named 'PyQt5' - beginners issue

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 5.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NewProgrammer
    wrote on 1 Feb 2022, 11:52 last edited by NewProgrammer 2 Jan 2022, 12:26
    #1

    Hi there,

    I am new to Qt. I downloaded and installed Qt from the website. I developed my application in Python, through Spyder IDE. Now i want to make the interface using Qt creator.

    Situation:

    1. Installed Qt.
    2. Run the most basic example available online (https://doc.qt.io/qtforpython/tutorials/qmlapp/qmlapplication.html)
    3. Receive the following error: ModuleNotFoundError: No module named 'PyQt5'

    More info:

    1. Pip list: PyQt5 5.12 is installed. (no virtual environment in place)
    2. Installed folder of PyQt5: "C:\Users{user}\AppData\Roaming\Python\Python38\site-packages\PyQt5\QtGui.pyd"
    3. When running Qt: Kit: Desktop
    4. Evaded PyQt5, used a different example with PySide6: similar issue: "ModuleNotFoundError: No module named 'PySide6'.

    Further:

    1. I checked Qt application to see if I may force the application to look at the PyQt5 folder for the module: I could not find a way to force Qt.
    2. I checked QML2_IMPORT_PATH: but found no correct explanation on how to actually implement it..

    What did I miss when Installing Qt?
    How to solve this issue?

    Thank you, Kind regards,

    Ivo

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NYBL
      wrote on 3 Feb 2022, 06:48 last edited by NYBL 2 Mar 2022, 06:49
      #2
      • Check your python path.

      • If you did pip install on a venv you should select it as the python interperter.

      • It would be nice if you will take screenshot of how you import and the above two suggestions

      1 Reply Last reply
      0
      • N Offline
        N Offline
        NewProgrammer
        wrote on 8 Feb 2022, 15:13 last edited by
        #3

        Thank you for your reply. I tried several solutions compared to last week.

        1. Identified two python versions. So I created a new virtual environment.
        2. I stopped with PyQt5 as I could not find an installation that seemed to work.
        3. I installed and uninstalled python and PySide2: untill PySide worked on my IDE (Spyder), in versions: PySide2 5.13.2 and Python 3.6.13.
        4. Set QT to look at the new virtual environment python.exe
        5. In QT i was however still unable to run a simple example: I received DLL errors. Also, on the Spyder (IDE), when trying to view a qml example, there were no warnings, but also no pop-up. PySide2 without qml works however.

        pythonpath.jpg QtDLLloadfailed.jpg

        Any tips?

        Thank you.

        Kind regards,
        Ivo

        1 Reply Last reply
        0

        3/3

        8 Feb 2022, 15:13

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved