Arch Linux with Qt5 getting "the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class"

Issue #128 resolved
Mohd Lee created an issue

I'm running FlatCAM using python2.7 on up to date Arch Linux x64 and have all the necessary library and package installed. I keep getting the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class until I added 2 lines in PlotCanvas.py

from PyQt4 import QtGui, QtCore
import matplotlib #new line
matplotlib.use("Qt4Agg") #new line

Not sure if this applies to other distro.

Comments (7)

  1. Mohd Lee reporter

    Sorry, did I post it at the wrong place? Yes, it won't start, throwing the exception, but I managed to fix it by add the 2 lines of code. Though not sure if that's applicable for other distro.

  2. Juan Pablo Caram repo owner

    This is the right place. Please post the exact error.

    I think this is starting to become a problem because of the other packages adopting Qt5. Your fix is probably the correct thing to do. Will need to test it on other distributions/versions.

  3. Mohd Lee reporter
    python2.7 FlatCAM.py
    
    Traceback (most recent call last):
      File "FlatCAM.py", line 3, in <module>
        from FlatCAMApp import App
      File "/home/faulty/build/flatcam/FlatCAMApp.py", line 20, in <module>
        from PlotCanvas import *
      File "/home/faulty/build/flatcam/PlotCanvas.py", line 11, in <module>
        from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
      File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 17, in <module>
        from .backend_qt5agg import NavigationToolbar2QTAgg
      File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 18, in <module>
        from .backend_qt5 import QtCore
      File "/usr/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 27, in <module>
        import matplotlib.backends.qt_editor.figureoptions as figureoptions
      File "/usr/lib/python2.7/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 17, in <module>
        import matplotlib.backends.qt_editor.formlayout as formlayout
      File "/usr/lib/python2.7/site-packages/matplotlib/backends/qt_editor/formlayout.py", line 58, in <module>
        from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
      File "/usr/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py", line 111, in <module>
        from PyQt5 import QtCore, QtGui, QtWidgets
    RuntimeError: the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class
    
  4. Log in to comment