question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

qtconsole does not work with pyqt5 5.11 ("ModuleNotFoundError: No module named 'sip'")

See original GitHub issue

On a fresh windows machine with python 3.7.0, after installing the following:

pip install ipython notebook qtconsole pyqt5

Running ipython qtconsole opens an Error startin QtConsole dialog with the following error:

---------------------------
Error starting QtConsole
---------------------------
Traceback (most recent call last):
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\IEUser\AppData\Local\Programs\Python\Python37-32\Scripts\ipython.exe\__main__.py", line 9, in <module>
    sys.exit(start_ipython())
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\IPython\__init__.py", line 125, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-113>", line 2, in initialize
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\IPython\terminal\ipapp.py", line 308, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\IPython\core\application.py", line 450, in initialize
    self.parse_command_line(argv)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\IPython\terminal\ipapp.py", line 303, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "<decorator-gen-4>", line 2, in parse_command_line
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\traitlets\config\application.py", line 514, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\IPython\core\application.py", line 243, in initialize_subcommand
    return super(BaseIPythonApplication, self).initialize_subcommand(subc, argv)
  File "<decorator-gen-3>", line 2, in initialize_subcommand
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\traitlets\config\application.py", line 445, in initialize_subcommand
    subapp = import_item(subapp)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\ipython_genutils\importstring.py", line 31, in import_item
    module = __import__(package, fromlist=[obj])
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\qtconsole\qtconsoleapp.py", line 60, in <module>
    from qtconsole.qt import QtCore, QtGui
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\qtconsole\qt.py", line 23, in <module>
    QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\qtconsole\qt_loaders.py", line 365, in load_qt
    result = loaders[api]()
  File "c:\users\ieuser\appdata\local\programs\python\python37-32\lib\site-packages\qtconsole\qt_loaders.py", line 270, in import_pyqt5
    import sip
ModuleNotFoundError: No module named 'sip'

The same error will appear if trying to run the command:

import sip

from a python shell, however the following works OK:

 from PyQt5 import sip

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ChiChoucommented, Mar 13, 2020

How do I downgrade my PyQt5 to 5.10.x?

pip install pyqt5==5.10.1

1reaction
392781commented, Sep 20, 2018

Ok, I’ll look at it tomorrow. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No module named PyQt5.sip - python - Stack Overflow
The reason is a backward incompatible change in PyQt-5.11. In geoptics this fix works on old and new versions: try: # new location...
Read more >
Importerror no module named sip : Tricks to Handle
We can fix "importerror no module named sip" error by installing PyQt5 python module. We should always ensure the path for PyQt5 python...
Read more >
mu-editor/general - Gitter
from PyQt5.QtCore import QTimer, Qt ModuleNotFoundError: No module named 'PyQt5.sip'. I did scroll all the way to the end. Nicholas Tollervey.
Read more >
[PyQt] ModuleNotFoundError: No module named 'PyQt5.sip'
Is anyone else seeing this error when building Python, sip-5.11.3, and PyQt5-5.11.2 from source on MacOSX (Mojave)? I am using Python-3.6.4.
Read more >
Installation — Jupyter Qt Console 5.4.0 documentation
Although pip and conda may be used to install the Qt console, conda is simpler to use since it automatically installs PyQt.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found