简体   繁体   English

ModuleNotFoundError:没有名为“PyQt4”的模块

[英]ModuleNotFoundError: No module named 'PyQt4'

I am totally new to programming.我对编程完全陌生。 I have 8 years of work experience in Network data domain and have very less understanding of programming.我在网络数据领域有 8 年的工作经验,对编程的了解很少。 When ever i try to run my first GUI based python program I always get error "ModuleNotFoundError: No module named 'PyQt4'".当我尝试运行我的第一个基于 GUI 的 Python 程序时,我总是收到错误“ModuleNotFoundError:没有名为‘PyQt4’的模块”。 I did uninstall and reinstall of python many times but no luck.我确实多次卸载并重新安装了python,但没有运气。 Till no i was using Python 3.6.2.直到没有我使用 Python 3.6.2。 Kindly suggest me how to resolve this and move further or which version should i use of python.请建议我如何解决这个问题并进一步移动或者我应该使用哪个版本的python。 Also, it will be very helpful if you explain me step by step to resolve this issue.此外,如果您逐步向我解释以解决此问题,这将非常有帮助。

Try this:试试这个:

apt-cache search pyqt
sudo apt-get install python-qt4

or else you can find all the pyqt and its related packages here for downloading and installing.否则,您可以在此处找到所有 pyqt 及其相关软件包以供下载和安装。

Also refer this .也参考这个

If you are on a Windows system, run: pip install python-qt5 to get PyQt5 .如果您使用的是 Windows 系统,请运行: pip install python-qt5以获取PyQt5

This is the best way to install if you are new because it puts every file and things in the right place.如果您是新手,这是最好的安装方式,因为它会将每个文件和内容都放在正确的位置。 I would consider using PyQt5 as it is able to be installed with pip .我会考虑使用PyQt5因为它可以与pip一起安装。 If you have any questions, don't hesitate to ask.如果您有任何问题,请随时提出。

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

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