問題描述
我剛剛在我的 Windows 系統(tǒng)上安裝了帶有 Python 3.6 的 Anaconda 5.2.還通過具有管理員權(quán)限的 pip 安裝了 pyqt5 和 pyqt5-tools.現(xiàn)在,當(dāng)我運(yùn)行 pyuic5.exe 來轉(zhuǎn)換 ui 文件時(shí),它顯示以下錯(cuò)誤:
I have just installed Anaconda 5.2 with Python 3.6 on my windows system. Also installed pyqt5 and pyqt5-tools via pip with administrator privilege. Now when I run pyuic5.exe for converting ui files it shows following error:
Traceback (most recent call last):
File "C:UsersAshfaqurRahmanAnaconda3lib
unpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:UsersAshfaqurRahmanAnaconda3lib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:UsersAshfaqurRahmanAppDataRoamingPythonPython36site-packagesPyQt5uicpyuic.py", line 26, in <module>
from PyQt5 import QtCore
ModuleNotFoundError: No module named 'PyQt5.sip'
我嘗試使用 pip 安裝 PyQt5-sip 包.但是它已經(jīng)安裝在我的系統(tǒng)中了.
I have tried installing PyQt5-sip package using pip. Buts its already installed in my system.
為什么會出現(xiàn)這個(gè)問題?我該如何解決這個(gè)問題?
Why this problem is occurring? How can I solve this problem?
推薦答案
根據(jù)Agile_Eagle的建議來自我剛剛卸載了 pyqt5
和 pyqt5-tools
軟件包并重新安裝了它們的評論.問題解決了!
According to Agile_Eagle's suggestion from the comments I just uninstalled pyqt5
and pyqt5-tools
packages and the reinstalled them. Problem solved!
PS.:如果您仍然遇到 PyQt 問題,請嘗試卸載所有 PyQt 相關(guān)庫:
PS.: If you still got problems with PyQt, try uninstalling all of the PyQt related libraries:
pip uninstall PyQt5
pip uninstall PyQt5-sip
pip uninstall PyQtWebEngine
然后重新安裝它們,這將修復(fù):
Then install them again, this will fix:
ModuleNotFoundError: No module named 'PyQt5.sip'
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
PPS.:如果您在卸載庫時(shí)遇到問題,請轉(zhuǎn)到您的 Python 文件夾,例如 C:Users<USERNAME>AppDataLocalProgramsPythonPython<PYTHON-VERSION>Libsite-packages
并手動刪除 PyQt 文件夾,然后卸載所有內(nèi)容并重新安裝(確保您擁有最新的 Python 版本并升級您的 pip)
PPS.:If you got problems uninstalling the libraries, go to your Python folder, like C:Users<USERNAME>AppDataLocalProgramsPythonPython<PYTHON-VERSION>Libsite-packages
and manually delete the PyQt folders, then uninstall everything and install again (Make sure you have the latest Python version and upgraded your pip too)
這篇關(guān)于pyuic5 - ModuleNotFoundError:沒有名為 PyQt5.sip 的模塊的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!