开发者

PyQt4.QtCore doesn't contain many of its classes and attributes

开发者 https://www.devze.com 2023-02-01 02:43 出处:网络
I have built PyQt4 from source and everything went smoothly until I tried to use some of the classes and attributes located in QtCore. For some reason QtCore is missing a lot of functionality and data

I have built PyQt4 from source and everything went smoothly until I tried to use some of the classes and attributes located in QtCore. For some reason QtCore is missing a lot of functionality and data that should be there. For example from PyQt4.QtCore import QT_VERSION_STR is an import error. There were no errors or warnings given when building the package开发者_如何学Cs and I have also tried with the PyQt packages from yum but I have the same problem.

Has anyone else encountered this problem before?

Thanks.


If it's really an ImportError, that suggests that it's failing to import the library altogether. Check that it's definitely somewhere that's in your sys.path, and that from PyQt4 import QtCore works.

If the library exists, and QT_VERSION_STR doesn't exist, it will give you a NameError rather than an ImportError.


The reason for this problem was a conflict in my python path. I had two modules named sip.py in different locations on my python path, the python path was using the first one but I wanted it to use the second one. I removed the first entry from the python path as it wasn't necessary.

0

精彩评论

暂无评论...
验证码 换一张
取 消