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.

Output of C extensions is not shown in IPython console

See original GitHub issue

Description of your problem

The output of C extensions that print to stdout is not shown in the ipython console. For Spyder 2 the output was shown in the kernel window.

A minimal example:

import oapackage
T=oapackage.conference_transformation_t()
T.show()

When executed from the command line a message is shown, in the Spyder 3 ipython console no output is shown at all.

Note: oapackage can by installed from pypi: https://pypi.python.org/pypi/OApackage. The output desired is generated by C++ code wrapped using SWIG.

Note: the same problem is there when the code is executed in an ipython notebook.

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
YWallercommented, Mar 23, 2018

Any update on this issue? I’d like to get tensorflow logs in my console…

1reaction
minrkcommented, Apr 20, 2022

It can’t be toggled at runtime (except with some private API calls), but you can disable it globally:

# ipython_config.py
c.IPKernelApp.capture_fd_output = False
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can stdout of a C extension to a python 3 app with no ...
The goal is to have all stdout from python and c extensions logged to the same file. Because this is a windows application...
Read more >
IPython Console — Spyder 5 documentation
Spyder showing opening a new Ipython Console. From the same menu, you can stop currently executing code with Interrupt kernel, clear a console's...
Read more >
autoreload — IPython 3.2.1 documentation
IPython extension to reload modules before executing user code. ... List modules which are to be automatically imported or not to be imported....
Read more >
Built-in magic commands — IPython 8.7.0 documentation
To work properly, Magics must use a syntax element which is not valid in the underlying language. For example, the IPython kernel uses...
Read more >
IPython REPL (interactive window) - Visual Studio
Examine the Packages (Conda) tab (which may appear as pip or Packages) for that environment to make sure that ipython and matplotlib are...
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