Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

[Linux] ImportError: cannot import name 'QtWidgets' from 'PyQt5'

29

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
29

【Linux】 ImportError: cannot import name 'QtWidgets' from 'PyQt5'

Posted at 1/12/2023 19:10:34      View:2457 | Replies:1        Print      Only Author   [Copy Link] 1#
  • Type: Official Firmware
  • Filename: ImportError: cannot import name 'QtWidgets' from '
  • Download Address: ix-q@ya.ru
  • Log: test.rar
Problem description and steps to reproduce:
Please help me.
Python 3.9.5
is installed PyQt5 is installed

The PyQt5 module itself is imported without errors. (import PyQt5)
When you connect sub module QtWidgets
from PyQt5 import QtWidgets

An error occurs ->

ImportError: cannot import name 'QtWidgets' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/__init__.py)


test.rar

560 Bytes, Down times: 1

Reply

Use props Report

29

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
29
Posted at 1/20/2023 13:11:31        Only Author  2#
The problem was solved thanks to the forum
History list
    1  ls -l
    2  python -V
    3  python3 -V
    4  python3 -m venv venv
    5  sudo pip3 install
    6  sudo apt-get update
    7  sudo apt-get -y install python3-pip
    8  pip3 --version
    9  pip3 list
   10  python3
   11  sudo apt-get -y install pacman
   12  pacman -S qt5-base qt5-declarative qt5-location qt5-script qt5-sensors qt5-svg qt5-tools  qt5-translations qt5-webchannel qt5-webkit qt5-x11extras qt5-xmlpatterns
   13  pacman -S qt5-base
   14  pacman -V
   15  sudo pacman -Ss qt5
   16  sudo pacman -S qt5
   17  sudo pacman -S qt5-base
   18  su pacman -S qt5-base
   19  pacman -S qt5-base
   20  pip3 install qt5-base qt5-declarative qt5-location qt5-script qt5-sensors qt5-svg qt5-tools  qt5-translations qt5-webchannel qt5-webkit qt5-x11extras qt5-xmlpatterns
   21  pip3 install qt5-base qt5-declarative qt5-location qt5-script qt5-sensors qt5-svg qt5-tools  qt5-translations q-webchannel qt5-webkit qt5-x11extras qt5-xmlpatterns
   22  ls /lib/x86_64-linux-gnu/libQt5Core.so*
   23  sudo apt-get install python3-pyqt5.qtopengl
   24  python3
   25  sudo apt-get install g++ ruby gperf bison flex sqlite libsqlite3-dev libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libgl1-mesa-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libpulse-dev libdbus-1-dev libssl-dev libcups2-dev libicu-dev
   26  pip3 install qt5-es2-*
   27  apt-get install qt5*-dev
   28  su apt-get install qt5*-dev
   29  sudo apt-get install qt5*-dev
   30  python3
   31  sudo apt install qtdeclarative5-dev
   32  python3
   33  conda install -c ipa pyqt5
   34  pacman -S qt5-base qt5-declarative qt5-location qt5-script qt5-sensors qt5-svg qt5-tools  qt5-translations qt5-webchannel qt5-webkit qt5-x11extras qt5-xmlpatterns
   35  pip 3 install PyQt5-sip
   36  pip3 install PyQtWebEngine
   37  pip uninstall PyQtWebEngine
   38  pip uninstall PyQtWebEngine-qt5
   39  pip install PyQtWebEngine-qt5
   40  pip install PyQtWebEngine
   41  python3
   42  pip install PySide2
   43  pip3 install PySide2
   44  history
   45  $sudo apt-get install python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns python3-pyside2uic
   46  su
   47  python3
   48  pip3 install libqt5opengl5-dev
   49  sudo apt install libqt5opengl5-dev
   50  sed -i 's/.*wiki.t-firefly.com.*/\#&/' /etc/apt/sources.list
   51  apt install libqt5opengl5-dev
   52  sed -i '/.*wiki.t-firefly.com.*/s/^#//' /etc/apt/sources.list
   53  su
   54  python3
   55  QT_QPA_PLATFORM=xcb rviz
   56  QT_QPA_PLATFORM=xcb rqt
   57  sudo apt install rviz
   58  sudo apt install rqt
   59  sudo apt install gazebo
   60  python3
   61  python2
   62  python3
   63  echo "export QT_QPA_PLATFORM=xcb" >> /~/.bashrc
   64  sudo apt update
   65  sudo apt install qt5-default qtmultimedia5-dev
   66  reboot
   67  su reboot
   68  python3
   69  history
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list