공부중

[터틀봇3] rqt 실행 오류 ImportError: Could not find Qt binding (looked for: 'pyqt', 'pyside'): 본문

인공지능...?/터틀봇 프로젝트

[터틀봇3] rqt 실행 오류 ImportError: Could not find Qt binding (looked for: 'pyqt', 'pyside'):

복습 2024. 10. 10. 10:17
728x90

ros2 humble

22.04

 

이제는 뭔 rqt까지 오류가 떠.. 

~$ rqt
Traceback (most recent call last):
  File "/opt/ros/humble/bin/rqt", line 33, in <module>
    sys.exit(load_entry_point('rqt-gui==1.1.7', 'console_scripts', 'rqt')())
  File "/opt/ros/humble/lib/python3.10/site-packages/rqt_gui/main.py", line 94, in main
    sys.exit(Main().main())
  File "/opt/ros/humble/lib/python3.10/site-packages/rqt_gui/main.py", line 62, in main
    return super(Main, self).main(
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/qt_gui/main.py", line 418, in main
    from python_qt_binding import QT_BINDING
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/__init__.py", line 56, in <module>
    from python_qt_binding.binding_helper import loadUi  # noqa: F401
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 277, in <module>
    _select_qt_binding(
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 118, in _select_qt_binding
    raise ImportError(
ImportError: Could not find Qt binding (looked for: 'pyqt', 'pyside'):
  ImportError for 'pyqt': No module named 'PyQt5.sip'
Traceback (most recent call last):
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding
    QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 153, in _load_pyqt
    _named_import('PyQt5.%s' % module_name)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 133, in _named_import
    module = builtins.__import__(name)
ModuleNotFoundError: No module named 'PyQt5.sip'

  ImportError for 'pyside': /usr/local/lib/python3.10/dist-packages/PyQt5/Qt/lib/libQt5Core.so.5: version Qt_5.15' not found (required by /usr/lib/python3/dist-packages/PySide2/QtCore.cpython-310-x86_64-linux-gnu.so)
Traceback (most recent call last):
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 108, in _select_qt_binding
    QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 185, in _load_pyside
    _named_import('PySide2.%s' % module_name)
  File "/opt/ros/humble/local/lib/python3.10/dist-packages/python_qt_binding/binding_helper.py", line 133, in _named_import
    module = builtins.__import__(name)
ImportError: /usr/local/lib/python3.10/dist-packages/PyQt5/Qt/lib/libQt5Core.so.5: version Qt_5.15' not found (required by /usr/lib/python3/dist-packages/PySide2/QtCore.cpython-310-x86_64-linux-gnu.so)

 

 

이것저것해서 정확히 뭐 때문에 문제가 해결된건지는 모르겠지만.. 한거를 적어보면.. 

echo 'export PATH=$PATH:/home/robo/.local/bin' >> ~/.bashrc

 

 

라이브러리 경로 설정 

export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

 

 

LD_LIBRARY_PATH 확인 및 수정

echo $LD_LIBRARY_PATH

먼저 이거로 확인 .. 뭔가 많이 나왔음. 

 

$ echo $LD_LIBRARY_PATH
/lib/x86_64-linux-gnu:/home/robo/turtlebot3_ws/install/turtlebot3_msgs/lib:/home/robo/turtlebot3_ws/install/dynamixel_sdk_custom_interfaces/lib:/home/robo/turtlebot3_ws/install/dynamixel_sdk/lib:/usr/lib/x86_64-linux-gnu/gazebo-11/plugins:/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib:/usr/share/gazebo/../../lib/x86_64-linux-gnu/gazebo-11/plugins::/usr/share/gazebo/../../lib/x86_64-linux-gnu/gazebo-11/plugins:/usr/share/gazebo/../../lib/x86_64-linux-gnu/gazebo-11/plugins:

 

Qt 버전 경로가 중복되거나 불필요하게 설정되어 있는 경우 제거해야 합니다. 예를 들어, Qt 버전이 충돌하는 경로가 있는 경우 다음과 같이 환경 변수를 수정할 수 있습니다.

unset LD_LIBRARY_PATH

 

 export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/opt/ros/humble/lib

 

PyQt5 제거 및 설치 (sudo 사용)

sudo pip uninstall PyQt5 PySide2

 

? 뭐지 마지막으로 한게 삭제한거네 

 

history

473  rqt
  474  sudo apt install python3-pyqt5 python3-pyqt5.qtsvg
  475  sudo apt install python3-pyside2.qtcore
  476  source /opt/ros/humble/setup.bash
  477  rqt
  478  pip install PyQt5==5.14.2
  479  rqt
  480  pip install PyQt5
  481  rqt
  482  sb
  483  rqt
  484  sudo apt remove python3-pyqt5 python3-pyside2
  485  sudo apt autoremove
  486  sudo apt install python3-pyqt5 python3-pyqt5.qtsvg
  487  sudo apt install python3-pyside2
  488  ~sudo apt install python3-pyside2
  489  sudo apt install python3-pyside2
  490  sudo apt update
  491  rqt
  492  source /opt/ros/humble/setup.bash
  493  pip install PySide2
  494  echo 'export PATH=$PATH:/home/robo/.local/bin' >> ~/.bashrc
  495  sb
  496  rqt
  497  pip uninstall PyQt5
  498  rqt
  499  pip uninstall PySide2
  500  rqt
  501  ldconfig -p | grep Qt
  502  export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
  503  rqt
  504  cd 다운로드/
  505  ㅣㄴ
  506  ls
  507  vib
  508  echo $LD_LIBRARY_PATH
  509  퍄ㅠ
  510  vib
  511  unset LD_LIBRARY_PATH
  512  export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/opt/ros/humble/lib
  513  rqt
  514  unset LD_LIBRARY_PATH
  515  echo $LD_LIBRARY_PATH
  516  pip uninstall PyQt5 PySide2
  517  pip install PyQt5==5.15.6
  518  sudo apt install ros-humble-rqt
  519  rqt
  520* 
  521  unset LD_LIBRARY_PATH
  522  export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/opt/ros/humble/lib
  523  rqt
  524  cd
  525  history

 

 

 

 

 

728x90