Dandy Now!
  • [Python] pyqt5-tools 설치 에러
    2022년 09월 30일 18시 01분 09초에 업로드 된 글입니다.
    작성자: DandyNow
    728x90
    반응형

    PyQt5 설치 후 디자이너 사용을 위해 pyqt5-tools를 설치하려고 하였다.

    pip install pyqt5-tools
    PS C:\Users\rian\Documents\GitHub\rian-workspace\python-carmera-app> python -m pip install pyqt5-tools --user
    Collecting pyqt5-tools
      Using cached pyqt5_tools-5.15.4.3.2-py3-none-any.whl (29 kB)
    Collecting pyqt5==5.15.4
      Using cached PyQt5-5.15.4.tar.gz (3.3 MB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... error
      error: subprocess-exited-with-error
    
      │ exit code: 1
      ╰─> [29 lines of output]
          Traceback (most recent call last):
            File "C:\Users\rian\AppData\Local\Programs\Python\Python310-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 156, in prepare_metadata_for_build_wheel
              hook = backend.prepare_metadata_for_build_wheel
          AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
         
          During handling of the above exception, another exception occurred:
         
          Traceback (most recent call last):
            File "C:\Users\rian\AppData\Local\Programs\Python\Python310-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
              main()
            File "C:\Users\rian\AppData\Local\Programs\Python\Python310-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
            File "C:\Users\rian\AppData\Local\Programs\Python\Python310-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 160, in prepare_metadata_for_build_wheel
              whl_basename = backend.build_wheel(metadata_directory, config_settings)
            File "C:\Users\rian\AppData\Local\Temp\pip-build-env-0ipzq6jf\overlay\Lib\site-packages\sipbuild\api.py", line 46, in build_wheel
              project = AbstractProject.bootstrap('wheel',
            File "C:\Users\rian\AppData\Local\Temp\pip-build-env-0ipzq6jf\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 87, in bootstrap
              project.setup(pyproject, tool, tool_description)
            File "C:\Users\rian\AppData\Local\Temp\pip-build-env-0ipzq6jf\overlay\Lib\site-packages\sipbuild\project.py", line 584, in setup
              self.apply_user_defaults(tool)
            File "C:\Users\rian\AppData\Local\Temp\pip-install-o2tumrx_\pyqt5_95bb53ffcc1a4abc99cfae0b3a74144c\project.py", line 63, in apply_user_defaults
              super().apply_user_defaults(tool)
            File "C:\Users\rian\AppData\Local\Temp\pip-build-env-0ipzq6jf\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
              super().apply_user_defaults(tool)
            File "C:\Users\rian\AppData\Local\Temp\pip-build-env-0ipzq6jf\overlay\Lib\site-packages\sipbuild\project.py", line 236, in apply_user_defaults
              self.builder.apply_user_defaults(tool)
            File "C:\Users\rian\AppData\Local\Temp\pip-build-env-0ipzq6jf\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
              raise PyProjectOptionException('qmake',
          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.

    pyqt5-tools 설치 시 위와 같이 에러가 발생하였다. 이 문제가 발생하면 pyqt5-tools 대신 pyside2를 설치하면 디자이너를 사용할 수 있다.

     

    pip install pyside2

    C:\Users\사용자\AppData\Local\Programs\Python\Python310-32\Lib\site-packages\PySide2

    위 경로는-PC환경에 따라 다를 수 있지만-파이썬이 설치된 경로이며 "Lib\site-packages\PySide2"에 Qt Designer 실행 파일이 존재한다.

     


    2023-02-04 추가 내용

    pyside2 설치 에러
    >pip install pyside2
    ERROR: Could not find a version that satisfies the requirement pyside2 (from versions: none) ERROR: No matching distribution found for pyside2

    현재 pyside2는 3.5버전까지만 지원한다고 한다. 따라서 설치시 위와 같은 에러가 발생하였다(설치 진행한 Python 버전은 3.11.1). Qt designer를 직접 설치하는 방법으로 해결하였다.

     

    참고 자료

    https://zorba10004.tistory.com/313

     

    728x90
    반응형
    댓글