LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 02-06-2015, 02:14 PM   #1
rrrssssss
Member
 
Registered: Mar 2005
Posts: 288

Rep: Reputation: 34
PyQt4 - qt module fails to load in python 2.7


Hello forum,

I am having problems getting the "qt" module to load in python2.7 in Kubuntu 14.4 (Trusty) but it loads fine in Linux mint 13 (Maya). Linux mint uses PyQt3 and Kubuntu uses PyQt4. Both use Python 2x. and I am using Qt 4.8.6 in Kubuntu.

The command I use for this is:

Code:
roy@roy-kubuntu:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import qt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named qt
>>>
In Kubuntu, I have a "qt.so" in /usr/lib/python2.7/dist-packages/dbus/mainloop/qt.so

and I have "Qt.so" in /usr/lib/python2.7/dist-packages/PyQt4/Qt.so

I have tried installing other related packages, thinking I need dependencies, but nothing helps.

I need the "qt" module for a program I have but it gives errors, probably because when it calls for "qt", it can't find it.

Will somebody please help me or give me some hints?

All the best,
Roy

Last edited by rrrssssss; 02-06-2015 at 02:15 PM.
 
Old 02-06-2015, 03:37 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
The command is "import PyQt4". The package is "python-qt4" if you don't have it installed.

Results from my Debian box:
Code:
$ python
Python 2.7.9 (default, Dec 11 2014, 08:58:12) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
>>>
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Maemo PyQt4+Gstreamer Segfault (Python) Snark1994 Linux - Mobile 0 01-13-2011 04:13 PM
rt61pci kernel module fails to load in -current "Invalid module format" Interject Slackware 6 03-20-2010 01:48 AM
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 03:44 AM
Stani's Python Editor - Fails to load fopetesl Linux - Software 2 08-09-2008 10:47 AM
Python/PyQt4 - Newbie Structure question ocularb0b Programming 0 01-28-2008 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration