pyuic5 - ModuleNotFoundError:没有名为 PyQt5.sip 的模块

pyuic5 - ModuleNotFoundError: No module named PyQt5.sip(pyuic5 - ModuleNotFoundError:没有名为 PyQt5.sip 的模块)
本文介绍了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: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 包.但是它已经安装在我的系统中了.

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>AppDataLocalProgramsPythonPython<PYTHON-VERSION>Libsite-packages 并手动删除 PyQt 文件夹,然后卸载所有内容并重新安装(确保您拥有最新的 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)

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

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Multiprocessing on Windows breaks(Windows 上的多处理中断)
How to use a generator as an iterable with Multiprocessing map function(如何将生成器用作具有多处理映射功能的可迭代对象)
read multiple files using multiprocessing(使用多处理读取多个文件)
Why does importing module in #39;__main__#39; not allow multiprocessig to use module?(为什么在__main__中导入模块不允许multiprocessig使用模块?)
Trouble using a lock with multiprocessing.Pool: pickling error(使用带有 multiprocessing.Pool 的锁时遇到问题:酸洗错误)
Python sharing a dictionary between parallel processes(Python 在并行进程之间共享字典)