PyQt is not accessible from python3

Bug #400826 reported by Michael Helmling on 2009-07-17
This bug affects 30 people
Affects Status Importance Assigned to Milestone
python-qt4 (Debian)
Fix Released
python-qt4 (Ubuntu)

Bug Description

Binary package hint: python-qt4

With python3 and python-qt4 from current karmic packages, it's not possible to use the PyQt bindings, although PyQt supports python3 since version 4.5:

But I get this:
Python 3.0.1+ (r301:69556, Apr 15 2009, 17:25:52)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4

This is such a pity since python-3.x is _so_ much nicer than 2.x. ;-) Are there any problems with building pyqt for py3k?

Related branches

Michael Helmling (supermihi) wrote :

I have just compiled PyQt4 (and before SIP 4, which is needed for compiling pyqt, and which is also not available in its python3 version in the ubuntu repos) without any problems on a current 9.10 beta machine.

Changed in python-qt4 (Ubuntu):
importance: Undecided → Wishlist
Philip Muškovac (yofel) wrote :

Still doesn't work in lucid.

Changed in python-qt4 (Ubuntu):
status: New → Confirmed
awe (awekola) on 2010-01-22
Changed in python-qt4 (Ubuntu):
assignee: nobody → awe (awekola)
Changed in python-qt4 (Debian):
status: Unknown → New
Eric Lacombe (goretux) wrote :


I would like to know if this wish will be fulfill on Maverick?


Maybe. Work on this is going on in Debian. It's not clear if we will get there in time for Maverick.

Christian González (droetker) wrote :

Doesnt work in maverick.

Scott Kitterman (kitterman) wrote :

That is correct. The packaging work to support this didn't get done for Maverick.

IKT (ikt) wrote :

As someone who was quite unhappy at this issue I was surprised to find it works in natty.

Was this fixed somewhere down the line?

IKT (ikt) wrote :

Wops, to early, the module seems to import, but it doesn't seem to do anything else :s

Scott Kitterman (kitterman) wrote :

We've made progress on the packaging in Natty. Sip4 is now packaged to
support Python3 and it's one of the prerequisites for PyQt4. It's not there
yet though.

IKT (ikt) wrote :

What else needs to be done, is there somewhere I can track progress?

Christian González (droetker) wrote :

Can I help too? - I need this.

Scott Kitterman (kitterman) wrote :

Look at what was done in the sip4 packaging. PyQt4 needs similar. If you
think you make sense of it and have questions or a proposed solution feel free
to ping me on #kubuntu-devel on freenode (I'm ScottK there) or here in the

Dmitry Shachnev (mitya57) wrote :

Since Oneiric is moving to Python 3 by default, we really need it.
The upstream PyQt supports Python 3 for a very long time.

Of course, we need a separate package like python3-qt4.

Vitaly Chesnokov (chesn) wrote :

BTW, SUSE already has python3-qt4 package:

Maybe, it's possible to make use of their experience?

Scott Kitterman (kitterman) wrote :

I've got it mostly done, but I'll have a look.

Changed in python-qt4 (Debian):
status: New → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-qt4 - 4.9-1ubuntu1

python-qt4 (4.9-1ubuntu1) precise; urgency=low

  * Merge from Debian unstable, remaining changes:
    - Update install path in debian/python-qt4.install for multiarch

python-qt4 (4.9-1) unstable; urgency=low

  * Team upload

  [ Scott Kitterman ]
  * New upstream release (Closes: #653293)
    - Adds QtDbus module support (in python-qt4 - the existing python-qt4-dbus
      is still provided for python)
    - Add relevant to python-qt4.install and python3-pyqt4.install
    - Update relevant package descriptionts to mention QtDBus
    - Bump minimum python-sip-dev and python3-sip-dev version required to
    - Add Breaks for python[3]-sip4 (<< 4.13.1~)
    - Refreshed patches
  * Build for python3 (Closes: #558389) (LP: #400826)
    - Add python3-all-dev/dbg and python3-sip-dev/dbg to build-depends
    - Add python3-qt4-* packages
    - Add X-Python-Version to debian/rules
    - Adjust debian/rules and add install-arch-3.%: rule
    - Add .install files for new packages
    - Adjust .install files for python packages to install python2* and not
      python* files to avoid python3 files
  * Use --no-dbg-cleaning for dh_python2 and dh_python3
  * Fix debian/rules to remove empty directories
  * Drop obsolete Conflicts/Replaces
  * Update debian/copyright

  [ Felix Geyer ]
  * Add build-arch/build-indep targets.
 -- Felix Geyer <email address hidden> Thu, 29 Dec 2011 10:44:44 +0100

Changed in python-qt4 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.