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.

Debugger is flooded with QObject warnings if ipython is started with gui=qt5/4

See original GitHub issue

Dear ipython team,

I am facing a weird issue and can’t find anything elsewhere.

When I start ipython with any qt backend via ipython3 --gui=qt5 and want to use the debugger, it is flooded with warnings which can only be stopped by exiting the debugger.

In [1]: abc        # trigger error                                                                                                                                                                            
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-03cfd743661f> in <module>
----> 1 abc 

NameError: name 'abc' is not defined

In [2]: %debug        # debug post-mortem                                                                                                                                                                                 
> <ipython-input-1-03cfd743661f>(1)<module>()
----> 1 abc

ipdb> QObject: Cannot create children for a parent that is in a different thread.                                                                                                              
(Parent is QApplication(0x3880d10), parent's thread is QThread(0x2df86f0), current thread is QThread(0x7f5bcc00bbd0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QApplication(0x3880d10), parent's thread is QThread(0x2df86f0), current thread is QThread(0x7f5bcc00bbd0)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QApplication(0x3880d10), parent's thread is QThread(0x2df86f0), current thread is QThread(0x7f5bcc00bbd0)
QObject: Cannot create children for a parent that is in a different thread.
[...]

I see the same behavior when debugging with %debug fun(args).

I don’t develop with pyqt5, I only use it for visualization with matplotlib and pyqtgraph. This behavior prevents me from using the debugger, which is very cumbersome. I would be happy about any advice where start looking into this issue.


$ python -c "import IPython; print(IPython.sys_info())"
{'commit_hash': '254663068',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/home/user/.local/lib/python3.6/site-packages/IPython',
 'ipython_version': '8.0.0.dev',
 'os_name': 'posix',
 'platform': 'Linux-5.3.0-53-generic-x86_64-with-Ubuntu-18.04-bionic',
 'sys_executable': '/usr/bin/python3',
 'sys_platform': 'linux',
 'sys_version': '3.6.9 (default, Apr 18 2020, 01:56:04) \n[GCC 8.4.0]'}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
cpblcommented, Jun 18, 2020

@clemisch Thanks!!

pip3 install --upgrade --user prompt_toolkit

seems to solve the problem for me.

1reaction
jdmcbrcommented, Aug 17, 2020

Thanks @clemisch @cpbl @tacaswell for raising the issue and figuring out a solution. I just ran into the same issue after upgrading to ubuntu 20.04. Initially, the prompt_toolkit update did not resolve the issue for me, but I then noticed that I had prompt_toolkit==3.0.6 rather than prompt_toolkit==3.0.5. With 3.0.5, the issue went away. I wanted to document that here since this was the first post I found when I ran into the QObject warnings.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ipython debugger is flooded with Qt errors after pylab import
I can't use the debugger in ipython after importing anything pyqt related. If I don't import anything and debug an error post-mortem like...
Read more >
Errors and Debugging | Python Data Science Handbook
This section will briefly cover some options for controlling Python's exception reporting, followed by exploring tools for debugging errors in code. Controlling ...
Read more >
Debugger — Spyder 5 documentation
This allows breakpoints and the execution flow to be viewed and controlled right from the Spyder GUI, as well as with all the...
Read more >
IPython reference — IPython 3.2.1 documentation
You start IPython with the command: $ ipython [options] files. If invoked with no options, it executes all the files listed in sequence...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
Start by setting any breakpoints you need by clicking in the left margin of a notebook cell. · Then select the Debug Cell...
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