简体   繁体   English

没有名为“PyQt5.sip”的模块

[英]No module named 'PyQt5.sip'

when I tried upgrading my PyQt version to 5.14.0 and later landed up importing the packages as:当我尝试将 PyQt 版本升级到 5.14.0 并且后来登陆导入包时:

from PyQt5 import QtGui, QtWidgets, QtCore

it throws an error:它抛出一个错误:

runfile('C:/Users/Farhan Hyder .LAPTOP-R0TGSS2M/Desktop/BREATHE IN/Pred_WindowUI.py', wdir='C:/Users/Farhan Hyder .LAPTOP-R0TGSS2M/Desktop/BREATHE IN')
Traceback (most recent call last):

  File "C:\Users\Farhan Hyder .LAPTOP-R0TGSS2M\Desktop\BREATHE IN\Pred_WindowUI.py", line 9, in <module>
    from PyQt5 import QtGui, QtWidgets, QtCore

ModuleNotFoundError: No module named 'PyQt5.sip'

I also tried re-installing the libraries, but, unfortunately it didn't serve my purpose.我也尝试重新安装这些库,但不幸的是它没有达到我的目的。

As per eyllanesc's comment , try updating pip :根据eyllanesc 的评论,尝试更新pip

python -m pip install --upgrade pip

Then try reinstalling pyqt5 :然后尝试重新安装pyqt5

python -m pip install --upgrade pyqt5

It worked for me (though I actually used pip install --use-feature=2020-resolver pyqt5 for the new resolver).它对我有用(尽管我实际上使用了pip install --use-feature=2020-resolver pyqt5作为新的解析器)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM