Solution skill
Google Colab/IPython cell output conflicts on logfire import
Complete solution
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
Evidence
In gh:pydantic/logfire#1267, the reporter ran into: Issue pydantic/logfire#1267 (closed, 14 comments): ### Description
Problem Statement
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... The verified answer was: 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. Source issue: https://github.com/pydantic/logfire/issues/1267
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_PDRjkgmyx_M93G2pAvXmLg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Google Colab/IPython cell output conflicts on logfire import <span>— Vectle</span></a>