python3 python3.10 pyqt5 설치 오류 에러 qt pyqt pyqt5 pyqt5-tools pyqt5-plugins
pyqt 를 이용해서 GUI 프로그램을 만들려고 하는데 설치부터 오류가 났다.
어제 밤에 설치를 하다가 재부팅하면 해결될까 싶어 컴퓨터를 끄고 자고 일어났는데 역시나 해결되지 않는다.
pip , pip3 로도 해보고,
pip 를 업그레이드 해봤지만 해결되지 않았다.
찾아보니 버전에 문제인거 같은데, 너무 깊게들어가고 싶지 않은데 어쩔수 없는가보다..
PS C:\Users\billion> pip install pyqt5-tools
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
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [29 lines of output]
Traceback (most recent call last):
File "C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 144, 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\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 148, in prepare_metadata_for_build_wheel whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-env-qxizarja\overlay\Lib\site-packages\sipbuild\api.py", line 46, in build_wheel
project = AbstractProject.bootstrap('wheel',
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-env-qxizarja\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 87, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-env-qxizarja\overlay\Lib\site-packages\sipbuild\project.py", line 585, in setup
self.apply_user_defaults(tool)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-install-lixm6ew0\pyqt5_eb1bb256db794182875b98f490693d2c\project.py", line 63, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-env-qxizarja\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-env-qxizarja\overlay\Lib\site-packages\sipbuild\project.py", line 236, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-build-env-qxizarja\overlay\Lib\site-packages\pyqtbuild\builder.py", line 69, 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.
검색해보니, 파이썬 3.10 버전에서는 호환이 안되는건가 싶기도 하다. pyqt6 버전을 사용하라고 하더라.
if you're using a Python version that's above 3.10,
a downgrade to version 3.9 or older is recommended as pyqt tools ar still not compatible with >3.9 versions.
However, as I've seen here, you can try installing an specific 5.15 release version, so please try:
현재 설치된 내 PC의 파이썬은 3.10 버전이다.
C:\Users\billion> pip --version
pip 22.3 from C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip (python 3.10)
그래서 pyqt github에 찾아 봤다. 나와 같은 상황을 겪은 사람이 많은것 같다.
https://github.com/altendky/pyqt-tools/issues/106
100번 게시글에서 고쳤다고 해서 들어갔다.
https://github.com/altendky/pyqt-tools/issues/100
98번 게시글을 참조하라고 한다.
https://github.com/altendky/pyqt-tools/issues/98
Additionally, PyPi version requires PyQt5 5.15.4 while only 5.15.5 is compatible with Python 3.10. Pyqt5-plugins also need to be updated.
Workaround:
Remove all PyQt5 software.
Download from PyPi file PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl.
Rename it to PyQt5-5.15.4-py3-none-win_amd64.whl.
Install this file by pip.
Download from PyPi file pyqt5_plugins-5.15.4.2.2-cp39-cp39-win_amd64.whl.
Rename it to pyqt5_plugins-5.15.4.2.2-py3-none-win_amd64.whl.
Install this file by pip.
Install pyqt5-tools by pip form PyPi.
Thanks, I tried your hacks. It seems installed successfully now.
해결방법 how to fix
1) 우선 현재 설치된 pyqt 와 관련된 모든 프로그램을 삭제한다.
2) PyPi file PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl 을 다운 받고,
PyQt5-5.15.4-py3-none-win_amd64.whl 로 이름을 변경한다.
pip 를 이용하여 해당 파일을 설치한다.
3) PyPi file pyqt5_plugins-5.15.4.2.2-cp39-cp39-win_amd64.whl 을 다운받고,
pyqt5_plugins-5.15.4.2.2-py3-none-win_amd64.whl 로 이름을 변경한다.
pip 를 이용하여 해당 파일을 설치한다.
4) pyqt5-tools by pip form PyPi 를 설치한다.
1) pip uninstall pyqt5
2) 해당 경로를 찾아서 파일을 확인하니, 한바탕 삭제를 했는데도 여러 파일들이 남아있었다.
그래서 해당 경로에서 직접 남아있는 파일들을 삭제했다.
3) PyPi file PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl 를 다운 받기위에 홈페이지를 방문
근데, 하단에 pip will also build and install the bindings from the sdist package but Qt’s qmake tool must be on PATH.
라는 문구가 있는데, qmake 도구가 PATH 안에 있어야 한다는 문구가 보인다.
에러 문구에서도 봤던건데, 내 경로에 qmake 가 없다. 이게 문제였을까?
https://pypi.org/project/PyQt5/
Installation
The GPL version of PyQt5 can be installed from PyPI:
pip will also build and install the bindings from the sdist package but Qt’s qmake tool must be on PATH.
The sip-install tool will also install the bindings from the sdist package but will allow you to configure many aspects of the installation.
qmake is required for PyQt.
you have to install the Qt package from https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5
This will automatically create qmake executable.
You can add the qmake path to your windows path, incase the qmake is not added automatically.
your command to configure will be something like this,
python configure.py --qmake {System_path}/Qt/5.5/clang_64/bin/qmake
그래서 잠깐 옆길로 빠져서 qmake 를 path 에 등록한다. (의미가 없었다)
이메일 인증이 필요하기 때문에, 실제로 사용가능한 이메일을 입력해야 한다.
무엇을 설치해야 할지 몰라 일단 Design Tool 만 설치했다. (2.4GB 필요)
python configure.py --qmake C:\Qt\Tools\QtDesignStudio\qt5_design_studio_reduced_version\bin\qmake |
4) 5.15.4 버전 설치 파일 다운 받아 설치하기
PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl 파일 다운로드
5) 5.15.4 - plugins 설치 파일 다운 받아 설치하기
PyPi file pyqt5_plugins-5.15.4.2.2-cp39-cp39-win_amd64.whl 파일 다운로드
해당 파일들은 각 아래의 이름으로 변경 하였다. (변경하는 이유는 모르겠으나 시키는 대로함)
4번 파일 PyQt5-5.15.4-py3-none-win_amd64
5번 파일 pyqt5_plugins-5.15.4.2.2-py3-none-win_amd64
4번 파일 설치 > pip install pyqt5 파일 경로
C:\Users\billion> pip install C:\Users\billion\Downloads\PyQt5-5.15.4-py3-none-win_amd64.whl
Processing c:\users\billion\downloads\pyqt5-5.15.4-py3-none-win_amd64.whl
Requirement already satisfied: PyQt5-sip<13,>=12.8 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from PyQt5==5.15.4) (12.11.0)
Requirement already satisfied: PyQt5-Qt5>=5.15 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from PyQt5==5.15.4) (5.15.2)
Installing collected packages: PyQt5
WARNING: The scripts pylupdate5.exe, pyrcc5.exe and pyuic5.exe are installed in 'C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed PyQt5-5.15.4
5번 파일 설치 > pip install pyqt5-plugins 파일 경로
C:\Users\billion> pip install C:\Users\billion\Downloads\pyqt5_plugins-5.15.4.2.2-py3-none-win_amd64.whl
Processing c:\users\billion\downloads\pyqt5_plugins-5.15.4.2.2-py3-none-win_amd64.whl
Collecting click
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting qt5-tools<5.15.2.2,>=5.15.2.1.2
Downloading qt5_tools-5.15.2.1.2-py3-none-any.whl (13 kB)
Requirement already satisfied: pyqt5==5.15.4 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5-plugins==5.15.4.2.2) (5.15.4)
Requirement already satisfied: PyQt5-Qt5>=5.15 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5==5.15.4->pyqt5-plugins==5.15.4.2.2) (5.15.2)Requirement already satisfied: PyQt5-sip<13,>=12.8 in c:\users\부들부들\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5==5.15.4->pyqt5-plugins==5.15.4.2.2) (12.11.0)
Collecting qt5-applications<5.15.2.3,>=5.15.2.2.2
Downloading qt5_applications-5.15.2.2.2-py3-none-win_amd64.whl (60.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.9/60.9 MB 8.8 MB/s eta 0:00:00
Collecting click
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.8/82.8 kB 4.5 MB/s eta 0:00:00
Installing collected packages: qt5-applications, click, qt5-tools, pyqt5-plugins
WARNING: The script qt5-tools.exe is installed in 'C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed click-7.1.2 pyqt5-plugins-5.15.4.2.2 qt5-applications-5.15.2.2.2 qt5-tools-5.15.2.1.2
6) pyqt5-tools 설치하기
C:\Users\billion> pip install pyqt5-tools
Collecting pyqt5-tools
Using cached pyqt5_tools-5.15.4.3.2-py3-none-any.whl (29 kB)
Requirement already satisfied: python-dotenv in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5-tools) (0.21.0)
Requirement already satisfied: pyqt5-plugins<5.15.4.3,>=5.15.4.2.2 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5-tools) (5.15.4.2.2)
Requirement already satisfied: click in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5-tools) (7.1.2)
Requirement already satisfied: pyqt5==5.15.4 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5-tools) (5.15.4)
Requirement already satisfied: PyQt5-sip<13,>=12.8 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5==5.15.4->pyqt5-tools) (12.11.0)
Requirement already satisfied: PyQt5-Qt5>=5.15 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5==5.15.4->pyqt5-tools) (5.15.2)
Requirement already satisfied: qt5-tools<5.15.2.2,>=5.15.2.1.2 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5-plugins<5.15.4.3,>=5.15.4.2.2->pyqt5-tools) (5.15.2.1.2)
Requirement already satisfied: qt5-applications<5.15.2.3,>=5.15.2.2.2 in c:\users\billion\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from qt5-tools<5.15.2.2,>=5.15.2.1.2->pyqt5-plugins<5.15.4.3,>=5.15.4.2.2->pyqt5-tools) (5.15.2.2.2)
Installing collected packages: pyqt5-tools
WARNING: The script pyqt5-tools.exe is installed in 'C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pyqt5-tools-5.15.4.3.2
Successfully installed pyqt5-tools-5.15.4.3.2
설치는 잘 됐는데 계속 아래 에러가 떠서 확인해 보니 환경변수 설정이 안되어 있다고 출력됐다.
WARNING: The scripts pylupdate5.exe, pyrcc5.exe and pyuic5.exe are installed in 'C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script qt5-tools.exe is installed in 'C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts
해당 경로를 시스템 환경 변수에 추가한 다음에 다시 재설치 해줬다.
설치 경로에 가서 designer.exe 를 실행시켜봤다.
C:\Users\billion\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\qt5_applications\Qt\bin
잘 될 것 같다!
'IT.컴퓨터 > python 파이썬' 카테고리의 다른 글
PyQt5 를 이용한 GUI 프로그램 만들기 (qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "") (0) | 2022.10.29 |
---|---|
셀레니움(selenium) click() 클릭 / element not interactable 오류 에러 (0) | 2022.10.27 |