Linux,Unix,BSD/Jetson

[jetson] PyQt5 설치하기

채윤아빠 2023. 11. 26. 14:19
728x90
반응형

문제점 및 증상

pip3 명령을 이용하여 PyQt5를 설치하려고 하였더니, 다음과 같은 오류가 발생하였습니다.

nvidia@nvidia-OrinNX16G:~$ pip3 install pyqt5
Defaulting to user installation because normal site-packages is not writeable
Collecting pyqt5
  Downloading PyQt5-5.15.10.tar.gz (3.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 11.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      pyproject.toml: line 7: using '[tool.sip.metadata]' to specify the project metadata is deprecated and will be removed in SIP v7.0.0, use '[project]' instead
.
.
.
      sipbuild.pyproject.PyProjectOptionException
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

NVIDIA Jetson Orin NX 환경에서 간단하게 PyQt5를 설치하는 방법을 알아보겠습니다.


해결 방안

최신 PyQt5를 설치하려고 하면, 미리 빌드된 패키지를 제공하고 있지 않아서 직접 소스를 다운로드 받아서 빌드를 하면, 위와 같은 오류가 발생하였습니다.

수동으로 직접 설치하는 방법은 "PySide2 (Qt for python) installation on Jetson Xavier - #5 by Muscle_Oliver":https://forums.developer.nvidia.com/t/160796/5 여기에 정리되어 있습니다. 이 방법으로 시도하려다가 굳이 최신버전인 5.15가 아니어도 된다는 생각에 다시 찾아보니, 손쉽게 설치할 수 있는 방법이 있었습니다.


다음과 같이 "sudo apt-get install python3-pyqt5" 명령을 수행하면 됩니다.

nvidia@nvidia-OrinNX16G:~$ sudo apt-get install python3-pyqt5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libdouble-conversion3 libqt5core5a libqt5dbus5 libqt5designer5 libqt5gui5 libqt5help5
  libqt5network5 libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5test5
  libqt5widgets5 libqt5xml5 python3-sip qt5-gtk-platformtheme qttranslations5-l10n
Suggested packages:
  qt5-image-formats-plugins qtwayland5 python3-pyqt5-dbg
The following NEW packages will be installed:
  libdouble-conversion3 libqt5core5a libqt5dbus5 libqt5designer5 libqt5gui5 libqt5help5
  libqt5network5 libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5test5
  libqt5widgets5 libqt5xml5 python3-pyqt5 python3-sip qt5-gtk-platformtheme
  qttranslations5-l10n
0 upgraded, 18 newly installed, 0 to remove and 46 not upgraded.
Need to get 14.8 MB of archives.
After this operation, 67.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

설치되는 패키지들이 꾀 많았습니다만, 설치 이후에 PyQt 프로젝트들이 정상적으로 실행되었습니다.


참고자료