您的位置:首页 > 编程语言 > Qt开发

from PyQt4.QtCore import * ImportError: No module named QtCore

2016-01-08 17:29 495 查看
the error is :

from PyQt4.QtCore import *

ImportError: No module named QtCore

I have try several approach to solve this problem:

1. add path to current program

2.
os.chdir(os.getcwd())


3. uninstall
remove --purge
python-qt4 and reinstall

4. uninstall ‘autoremove python2.7’ and reinstall, my notebook failed to boot

5. reinstall my Ubuntu

all of the above tries turn outs dispointted.

On accasion, i fond that i can run my .py under home directory and i tried several directory, all succeed!

I try to seek causes from my original directory organisation:



Notice that we have an PyQt4 under my working directory and .py will search
from PyQt4.QtCore import *
from folder PyQt4 instead of system library. You need to remove the folder PyQt4.

THAT’S THE PROBLEM.

by the way. use pyuic4 to convert ui to py.

pyuic4 belongs to pyqt4-dev-tools
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: