Ubuntu 22.04에서 PyQt5의 진짜 혼란을 폭로하려고 하는데 제거할 수 없는 지점에 도달한 것 같아서 궁금합니다.왜정확히는 불가능합니다. 다음 오류가 발생합니다.
$ sudo -H pip3 uninstall PyQt5
Found existing installation: PyQt5 5.15.6
ERROR: Cannot uninstall PyQt5 5.15.6, RECORD file not found. Hint: The package was installed by sip-build.
설치된 파일은 다음과 같습니다:
$ ls /usr/local/lib/python3.10/dist-packages/PyQt5
Qt5 sip.cpython-310-x86_64-linux-gnu.so
추가 정보:
$ sudo -H pip3 list | grep -i qt
PyQt5 5.15.6
PyQt5-Qt5 5.15.2
PyQt5-sip 12.11.0
PyQtWebEngine 5.15.5
QtAwesome 1.1.1
qtconsole 5.3.0
QtPy 2.2.0
sphinxcontrib-qthelp 1.0.3
사용자 정의 PyQt5를 올바르게 제거하려면 어떻게 해야 합니까( /usr/local/lib/python3.10/dist-packages/ 아래에서현지의부분)?
/usr/lib/python3/dist-packages/PyQt5
이 폴더는 공식 apt 패키지를 설치하기 위해 시스템 패키지 관리자가 사용하는 폴더이기 때문에 제거하는 것이 아닙니다 python3-pyqt5
. 실제로 그렇게 하면 다른 많은 것들이 손상될 것입니다.
$ sudo apt-get autoremove --purge python3-pyqt5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
fonts-lyx* grass-core* grass-doc* libassimp5* libclang1-14* libdraco4* libfcgi-bin* libfcgi0ldbl* libjs-leaflet* liblaszip8* liblbfgsb0* libpdal-base13* libpdal-plugin-draco* libpdal-plugin-e57*
libpdal-plugin-faux* libpdal-plugin-hdf* libpdal-plugin-i3s* libpdal-plugin-icebridge* libpdal-plugin-pgpointcloud* libpdal-plugins* libpdal-util13* libqca-qt5-2* libqca-qt5-2-plugins* libqgis-3d3.26.2*
libqgis-analysis3.26.2* libqgis-app3.26.2* libqgis-core3.26.2* libqgis-customwidgets* libqgis-gui3.26.2* libqgis-native3.26.2* libqgis-server3.26.2* libqgisgrass7-3.26.2* libqgispython3.26.2*
libqscintilla2-qt5-15* libqscintilla2-qt5-l10n* libqt53danimation5* libqt53dcore5* libqt53dextras5* libqt53dinput5* libqt53dlogic5* libqt53dquickscene2d5* libqt53drender5* libqt5charts5* libqt5concurrent5*
libqt5designer5* libqt5designercomponents5* libqt5help5* libqt5keychain1* libqt5location5* libqt5opengl5* libqt5pdf5* libqt5positioningquick5* libqt5qml5* libqt5qmlmodels5* libqt5quick5* libqt5quickwidgets5*
libqt5sensors5* libqt5sql5* libqt5sql5-sqlite* libqt5test5* libqt5webchannel5* libqt5webengine-data* libqt5webengine5* libqt5webenginecore5* libqt5webenginewidgets5* libqt5webkit5* libqwt-qt5-6* libre2-9*
libspatialindex6* libsqlite3-mod-spatialite* libxsimd-dev* libzip4* pyqt5-dev-tools* python-babel-localedata* python-matplotlib-data* python3-babel* python3-beniget* python3-brotli* python3-cycler*
python3-decorator* python3-fonttools* python3-fs* python3-gast* python3-ipython-genutils* python3-jinja2* python3-jsonschema* python3-jupyter-core* python3-kiwisolver* python3-lz4* python3-matplotlib*
python3-mpmath* python3-nbformat* python3-owslib* python3-pbr* python3-plotly* python3-ply* python3-psycopg2* python3-pyproj* python3-pyqt5* python3-pyqt5.qsci* python3-pyqt5.qtpositioning*
python3-pyqt5.qtsql* python3-pyqt5.qtsvg* python3-pyqt5.qtwebchannel* python3-pyqt5.qtwebengine* python3-pyqt5.qtwebkit* python3-pyrsistent* python3-pythran* python3-qgis* python3-qgis-common* python3-scipy*
python3-sip* python3-sympy* python3-tenacity* python3-traitlets* python3-ufolib2* python3-unicodedata2* qdoc-qt5* qgis* qgis-common* qgis-plugin-grass* qgis-plugin-grass-common* qgis-provider-grass*
qgis-providers* qgis-providers-common* qhelpgenerator-qt5* qml-module-qtcharts* qt3d-assimpsceneimport-plugin* qt3d-defaultgeometryloader-plugin* qt3d-gltfsceneio-plugin* qt3d-scene2d-plugin* qt5-assistant*
qt5-image-formats-plugin-pdf* qtattributionsscanner-qt5* qttools5-dev-tools* unicode-data*
0 upgraded, 0 newly installed, 136 to remove and 0 not upgraded.
After this operation, 1’060 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
-H
나는 항상 플래그를 사용하여 sudo
패키지가 에 의해 설치된 패키지와 겹치지 않도록 대신 경로 apt
에 설치한다는 말을 들었지만 PyQt5를 사용하면 제거 명령이 패키지를 대신 제거하려는 것 같습니다 ... 왜죠? 왜냐하면 다음 내에서 PyQT5 폴더를 수동으로 제거하면 다음과 같습니다 ./usr/local/lib/...
/usr/lib/...
apt
/usr/local/lib/...
$ sudo rm -rf /usr/local/lib/python3.10/dist-packages/PyQt5*
그런 다음 설치를 다시 실행하려고 하면 좀 더 자세한 내용이 포함된 동일한 오류가 발생합니다.
$ sudo -H pip3 install -U PyQt5
Requirement already satisfied: PyQt5 in /usr/lib/python3/dist-packages (5.15.6)
Collecting PyQt5
Using cached PyQt5-5.15.7-cp37-abi3-manylinux1_x86_64.whl (8.4 MB)
Collecting PyQt5-sip<13,>=12.11
Using cached PyQt5_sip-12.11.0-cp310-cp310-manylinux1_x86_64.whl (359 kB)
Collecting PyQt5-Qt5>=5.15.0
Using cached PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl (59.9 MB)
Installing collected packages: PyQt5-Qt5, PyQt5-sip, PyQt5
Attempting uninstall: PyQt5
Found existing installation: PyQt5 5.15.6
ERROR: Cannot uninstall PyQt5 5.15.6, RECORD file not found. Hint: The package was installed by sip-build.
그러나 -U
( --upgrade
) 플래그가 없어도 잘 작동합니다.
$ sudo -H pip3 install PyQt5
Requirement already satisfied: PyQt5 in /usr/lib/python3/dist-packages (5.15.6)
Collecting PyQt5-sip<13,>=12.8
Using cached PyQt5_sip-12.11.0-cp310-cp310-manylinux1_x86_64.whl (359 kB)
Installing collected packages: PyQt5-sip
Successfully installed PyQt5-sip-12.11.0
실제로 이전에 수동으로 삭제한 폴더를 생성합니다./usr/local/lib/python3.10/dist-packages/PyQt5/
동일한 절차가 다른 많은 Python 패키지에서도 잘 작동하지만 PyQt5에서는 그렇지 않은 것 같습니다.
/usr/lib/python3/dist-packages/numpy/
예를 들어 numpy의 경우 (1.21.5)와 (1.23.2) 가 모두 있습니다
/usr/local/lib/python3/dist-packages/numpy/
.