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. PyQt6: DLL load failed while importing QtGui: The specified procedure could not be found.
QtWS25 Last Chance

PyQt6: DLL load failed while importing QtGui: The specified procedure could not be found.

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 3 Posters 16.2k 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.
  • T Offline
    T Offline
    tanzi
    wrote on last edited by tanzi
    #1

    My Environment

    • OS: Windows 10
    • Python: 3.9.9
    • Anaconda: Anaconda3-2022.05-Windows-x86_64
    • vitual environment: base,PyQt6
    • The output of the command pip list when the virtual environment is "PyQt6":
      Package          Version
      ---------------- ---------
      click            7.1.2
      pip              21.3.1
      PyQt6            6.1.0
      pyqt6-plugins    6.1.0.2.2
      PyQt6-Qt6        6.3.1
      PyQt6-sip        13.4.0
      pyqt6-tools      6.1.0.3.2
      python-dotenv    0.20.0
      qt6-applications 6.1.0.2.2
      qt6-tools        6.1.0.1.2
      setuptools       60.5.0
      wheel            0.37.1
      
    • The output of the command pip list|findstr "Qt" when the virtual environment is "base"
      PyQt6                         6.3.1
      PyQt6-Qt6                     6.3.1
      PyQt6-sip                     13.4.0
      QtAwesome                     1.0.3
      QtPy                          2.0.1
      

    The issue

    When the vritual environment is "PyQt6", the code from PyQt6 import QtWidgets throws the error below

    DLL load failed while importing QtGui: The specified procedure could not be found.

    But, when the vritual environment is "base", the code runs normally

    Why?How to solve it?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tanzi
      wrote on last edited by tanzi
      #2

      Another test

      First step, create a brand-new virtual environment, and then install PyQt6

      conda create -n PyQt6_2 python=3.9.9
      conda activate PyQt6_2
      pip install PyQt6
      

      Then, test the code from PyQt6 import QtWidgets

      Python
      >> from PyQt6 import QtWidgets
      

      Everything runs fine now.

      Second step, install PyQt6-tools

      pip install PyQt6-tools
      

      Then, the code from PyQt6 import QtWidgets will throw the error PyQt6: DLL load failed while importing QtGui: The specified procedure could not be found.

      Comparsion

      Before I installed PyQt6 , the output of pip list was

      Package    Version
      ---------- -------
      pip        21.3.1
      PyQt6      6.3.1
      PyQt6-Qt6  6.3.1
      PyQt6-sip  13.4.0
      setuptools 60.5.0
      wheel      0.37.1
      

      After I installed PyQt6 , the output of pip list was

      Package          Version
      ---------------- ---------
      click            7.1.2
      pip              21.3.1
      PyQt6            6.1.0
      pyqt6-plugins    6.1.0.2.2
      PyQt6-Qt6        6.3.1
      PyQt6-sip        13.4.0
      pyqt6-tools      6.1.0.3.2
      python-dotenv    0.20.0
      qt6-applications 6.1.0.2.2
      qt6-tools        6.1.0.1.2
      setuptools       60.5.0
      wheel            0.37.1
      

      The tests on base and PyQt6 virtual environments are the same with this test.

      • In the first test, the virtual environment base installed PyQt6 and not installed PyQt6-tools
      JonBJ 1 Reply Last reply
      0
      • T tanzi

        Another test

        First step, create a brand-new virtual environment, and then install PyQt6

        conda create -n PyQt6_2 python=3.9.9
        conda activate PyQt6_2
        pip install PyQt6
        

        Then, test the code from PyQt6 import QtWidgets

        Python
        >> from PyQt6 import QtWidgets
        

        Everything runs fine now.

        Second step, install PyQt6-tools

        pip install PyQt6-tools
        

        Then, the code from PyQt6 import QtWidgets will throw the error PyQt6: DLL load failed while importing QtGui: The specified procedure could not be found.

        Comparsion

        Before I installed PyQt6 , the output of pip list was

        Package    Version
        ---------- -------
        pip        21.3.1
        PyQt6      6.3.1
        PyQt6-Qt6  6.3.1
        PyQt6-sip  13.4.0
        setuptools 60.5.0
        wheel      0.37.1
        

        After I installed PyQt6 , the output of pip list was

        Package          Version
        ---------------- ---------
        click            7.1.2
        pip              21.3.1
        PyQt6            6.1.0
        pyqt6-plugins    6.1.0.2.2
        PyQt6-Qt6        6.3.1
        PyQt6-sip        13.4.0
        pyqt6-tools      6.1.0.3.2
        python-dotenv    0.20.0
        qt6-applications 6.1.0.2.2
        qt6-tools        6.1.0.1.2
        setuptools       60.5.0
        wheel            0.37.1
        

        The tests on base and PyQt6 virtual environments are the same with this test.

        • In the first test, the virtual environment base installed PyQt6 and not installed PyQt6-tools
        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @tanzi
        Sounds potentially like a "DLL found but required symbol within DLL not found", an inconsistency within the C++ Qt DLLs or between them and PyQt6. I would search my whole disk for e.g. dir /s/b Qt*.DLL. Any mixed versions? Any Qt5 artefacts? What version of PyQt6 versus Qt6 do you see?

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Plinio B
          wrote on last edited by
          #4

          the problem starts on PyQt version 6.0.3. Do not install other modules that depends on the version above 6.03. I solve the issue by installing PyQt 6.0.2 and pyqt6-tools 6.0.2

          my version list is the following

          Package Version


          click 7.1.2
          pip 21.3.1
          PyQt6 6.0.2
          pyqt6-plugins 6.0.2.2.2
          PyQt6-Qt 6.0.1
          PyQt6-Qt6 6.0.2
          PyQt6-sip 13.4.0
          pyqt6-tools 6.0.2.3.2
          python-dotenv 0.20.0
          qt6-applications 6.0.2.2.2
          qt6-tools 6.0.2.1.2
          setuptools 60.2.0
          wheel 0.37.1

          1 Reply Last reply
          1

          • Login

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