[PyQt] ImportError: No module named 'PyQt5.sip'

Dmitry Shachnev mitya57 at ubuntu.com
Tue Oct 16 15:37:23 BST 2018


Hi Patrick,

On Tue, Oct 16, 2018 at 06:54:06AM -0700, Patrick Stinson wrote:
> I’m in 16.06.

I assume you mean 16.04 which is the previous LTS release.

> I know that a recent version of PyQt5 changed the assumed location of the
> sip module. I have another thread started about this but related to
> pyqtdeploy-sysroot. So this thread is hinting that that change also breaks
> the Ubuntu package? Or maybe that is the Ubuntu responsibility? At any rate,
> I don’t fully understand what is going on and what to do about it.

Ubuntu 16.04 was released 2.5 years ago so ships quite old versions:
sip v4.17 and PyQt5 v5.5.1.

These versions were released way before PyQt5 switched to private copy of sip.
So you should use “import sip” instead of “import PyQt5.sip”.

Also you should not mix distro-packaged sip with PyQt5 from PyPI, and vice
versa. Install both packages from the same source.

If you are getting this error with distro packages and some third-party
application, then please be more verbose and name that application, or show us
the complete traceback.

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20181016/0c321f67/attachment.sig>


More information about the PyQt mailing list