PyQt5: NameError: 'QtWidget' is not defined - Ask Ubuntu
moving flask app local environment ubuntu 14.04. getting 'nameerror: 'qtwidgets' not defined"
have done following:
sudo apt-get install python3-pyqt5
verified following command:
apt-cache policy python3-pyqt5 result: "python3-pyqt5: installed: 5.2.1+dfsg-1ubuntu1 candidate: 5.2.1+dfsg-1ubuntu1 version table: ***5.2.1+dfsg-1ubuntu1 0 500 http://mirrors.digitalocean.com/ubuntu/ trusty/main amd64 packages"
tried following command python command line:
from pyqt5 import qtwidgets
got following response:
importerror: no module named 'pyqt5'
i'll admit being relatively new this, it's obvious experienced folks. in event insights can offer.
indeed simple: qtwidgets
, i.e. non-singular
>>> pyqt5.gui import qtwidget traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named 'pyqt5.gui' >>> pyqt5 import qtwidgets >>>
also, ensure you're calling correct interpreter. you've installed pyqt5 python3, use python3
:
$ python python 2.7.12 (default, jul 1 2016, 15:12:24) [gcc 5.4.0 20160609] on linux2 type "help", "copyright", "credits" or "license" more information. >>> pyqt5 import qtwidgets traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named pyqt5 >>> $ python3 python 3.5.2 (default, sep 10 2016, 08:21:44) [gcc 5.4.0 20160609] on linux type "help", "copyright", "credits" or "license" more information. >>> pyqt5 import qtwidgets >>>
Comments
Post a Comment