Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. pyqt5 in virtualenv "Cannot mix incompatible Qt library" error
Forum Updated to NodeBB v4.3 + New Features

pyqt5 in virtualenv "Cannot mix incompatible Qt library" error

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 613 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.
  • B Offline
    B Offline
    b-ak
    wrote on last edited by b-ak
    #1

    I have to deploy an application based on pyqt5. My setup requires everything to be done inside a python3 virtualenv.

    It is obvious from the logs that I have two versions of pyqt5. One that comes default with my ubuntu-18.04 installation and one that I setup in the virtualenv. And they are picking files from both the versions, which is creating conflicts.

    How do I make my system use only pyqt5 files from the virtualenv and not the system's installation ?

    b-ak@ideapad-330S ~/Coder/venv_0.2.0/lib/python3.6/site-packages/PyQt5/Qt/plugins [009f9b6 *]
    ± % dpkg -al | grep libqt                                                                                                                                                                                      !5014
    ii  libqt5core5a:amd64                    5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 core module
    ii  libqt5dbus5:amd64                     5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 D-Bus module
    ii  libqt5gui5:amd64                      5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 GUI module
    ii  libqt5help5:amd64                     5.9.5-0ubuntu1                          amd64        Qt 5 help module
    ii  libqt5network5:amd64                  5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 network module
    ii  libqt5sql5:amd64                      5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 SQL module
    ii  libqt5sql5-sqlite:amd64               5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 SQLite 3 database driver
    ii  libqt5svg5:amd64                      5.9.5-0ubuntu1                          amd64        Qt 5 SVG module
    ii  libqt5widgets5:amd64                  5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 widgets module
    ii  libqt5x11extras5:amd64                5.9.5-0ubuntu1                          amd64        Qt 5 X11 extras
    (venv_0.2.0) 
    b-ak@ideapad-330S ~/Coder/venv_0.2.0/lib/python3.6/site-packages/PyQt5/Qt/plugins [009f9b6 *]
    ± % pip3 install pyqt5                                                                                                                                                                                         
    Requirement already satisfied: pyqt5 in /home/b-ak/Coder/venv_0.2.0/lib/python3.6/site-packages (5.11.2)
    Requirement already satisfied: PyQt5_sip<4.20,>=4.19.11 in /home/b-ak/Coder/venv_0.2.0/lib/python3.6/site-packages (from pyqt5) (4.19.12)
    (venv_0.2.0) 
    b-ak@ideapad-330S ~/Coder/venv_0.2.0/lib/python3.6/site-packages/PyQt5/Qt/plugins [009f9b6 *]
    ± % python3 audio_gui.py                                                                 
    Cannot mix incompatible Qt library (version 0x50905) with this library (version 0x50b01)
    [1]    10863 abort      python3 audio_gui.py
    (venv_0.2.0)
    ± %   
    
    JonBJ 1 Reply Last reply
    0
    • B b-ak

      I have to deploy an application based on pyqt5. My setup requires everything to be done inside a python3 virtualenv.

      It is obvious from the logs that I have two versions of pyqt5. One that comes default with my ubuntu-18.04 installation and one that I setup in the virtualenv. And they are picking files from both the versions, which is creating conflicts.

      How do I make my system use only pyqt5 files from the virtualenv and not the system's installation ?

      b-ak@ideapad-330S ~/Coder/venv_0.2.0/lib/python3.6/site-packages/PyQt5/Qt/plugins [009f9b6 *]
      ± % dpkg -al | grep libqt                                                                                                                                                                                      !5014
      ii  libqt5core5a:amd64                    5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 core module
      ii  libqt5dbus5:amd64                     5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 D-Bus module
      ii  libqt5gui5:amd64                      5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 GUI module
      ii  libqt5help5:amd64                     5.9.5-0ubuntu1                          amd64        Qt 5 help module
      ii  libqt5network5:amd64                  5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 network module
      ii  libqt5sql5:amd64                      5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 SQL module
      ii  libqt5sql5-sqlite:amd64               5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 SQLite 3 database driver
      ii  libqt5svg5:amd64                      5.9.5-0ubuntu1                          amd64        Qt 5 SVG module
      ii  libqt5widgets5:amd64                  5.9.5+dfsg-0ubuntu1                     amd64        Qt 5 widgets module
      ii  libqt5x11extras5:amd64                5.9.5-0ubuntu1                          amd64        Qt 5 X11 extras
      (venv_0.2.0) 
      b-ak@ideapad-330S ~/Coder/venv_0.2.0/lib/python3.6/site-packages/PyQt5/Qt/plugins [009f9b6 *]
      ± % pip3 install pyqt5                                                                                                                                                                                         
      Requirement already satisfied: pyqt5 in /home/b-ak/Coder/venv_0.2.0/lib/python3.6/site-packages (5.11.2)
      Requirement already satisfied: PyQt5_sip<4.20,>=4.19.11 in /home/b-ak/Coder/venv_0.2.0/lib/python3.6/site-packages (from pyqt5) (4.19.12)
      (venv_0.2.0) 
      b-ak@ideapad-330S ~/Coder/venv_0.2.0/lib/python3.6/site-packages/PyQt5/Qt/plugins [009f9b6 *]
      ± % python3 audio_gui.py                                                                 
      Cannot mix incompatible Qt library (version 0x50905) with this library (version 0x50b01)
      [1]    10863 abort      python3 audio_gui.py
      (venv_0.2.0)
      ± %   
      
      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @b-ak
      This being a very PyQt question, like my https://forum.qt.io/post/482841 if you do not get a solution here try joining the "PyQt mailing list" (https://riverbankcomputing.com/mailman/listinfo/pyqt or similar) and ask there. And btw I found hassle with virtualenvs and stuck with Ubuntu distribution, though I realise you probably cannot afford this simplification.

      1 Reply Last reply
      0

      • Login

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