本文介绍了pyuic5-ModuleNotFoundError:没有名为PyQt5.sip的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Windows系统上安装了带有Python 3.6的Anaconda 5.2.还可以通过具有管理员权限的pip安装pyqt5和pyqt5-tools.现在,当我运行pyuic5.exe转换ui文件时,它显示以下错误:

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:\Users\AshfaqurRahman\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "C:\Users\AshfaqurRahman\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "C:\Users\AshfaqurRahman\AppData\Roaming\Python\Python36\site-packages\PyQt5\uic\pyuic.py", line 26, in <module>
from PyQt5 import QtCore
ModuleNotFoundError: No module named 'PyQt5.sip'

我尝试使用pip安装PyQt5-sip软件包.但是它已经安装在我的系统中.

I have tried installing PyQt5-sip package using pip. Buts its already installed in my system.

为什么会出现此问题?我该如何解决这个问题?

Why this problem is occurring? How can I solve this problem?

推荐答案

根据 Agile_Eagle 的建议,我刚刚卸载了pyqt5pyqt5-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相关的库:

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

然后再次安装它们,它将解决:

Then install them again, this will fix:

ModuleNotFoundError: No module named 'PyQt5.sip'
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'

PPS .:如果在卸载库时遇到问题,请转到Python文件夹(如C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python<PYTHON-VERSION>\Lib\site-packages)并手动删除PyQt文件夹,然后卸载所有内容并再次安装(确保您具有最新的Python版本并升级了pip也是

PPS.:If you got problems uninstalling the libraries, go to your Python folder, like C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python<PYTHON-VERSION>\Lib\site-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)

这篇关于pyuic5-ModuleNotFoundError:没有名为PyQt5.sip的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 23:47