Google Colab/IPython cell output conflicts on logfire import
Shows how to fix google Colab/IPython cell output conflicts on logfire import. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
We have previously run some python scripts via Google Colab notebooks, usually using the shell command !uv run my\_script.py. Logfire configures properly within the script and the script itself executes perfectly.
Steps
- We have previously run some python scripts via Google Colab notebooks, usually using the shell command
!uv run my_script.py. After instrumenting the codebase with logfire, there is some unexpected behavior blocking cell output.
- Logfire configures properly within the script and the script itself executes perfectly. Spans and instrumented functions, auto-instrumented objects, etc are all properly logged and sent to the dashboard. However, the cell output shows
Logfire Project URL: ____ (blank)in the output, rendered as expecting input but no change...
- If importing logfire in a Colab/IPython notebook blocks cell output (showing a blank 'Logfire Project URL' prompt), check for a duplicate logfire.configure() call, e.g. one hiding in an init.py that runs alongside your own. That was the reporter's root cause. Setting logfire.configure(console=False) suppresses the project URL printout.
When to use
You are seeing this: Issue pydantic/logfire#1267 (closed, 14 comments): ### Description Use this skill when you run into "Google Colab/IPython cell output conflicts on logfire import".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/pydantic/logfire/issues/1267
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.