Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix issue with default renderer when ipython is installed #5258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
emilykl merged 3 commits into main from fix-default-renderer-when-ipython-installed
Oct 1, 2025

Conversation

@emilykl
Copy link
Contributor

@emilykl emilykl commented Jun 30, 2025
edited
Loading

Closes #5257

Reverts change to plotly/io/_renderers.py added in #5096 to keep the original logic flow of the if statement.

Adds a test to ensure that the default renderer is "browser" while running the tests; since the test_optional workflow installs jupyter which installs ipython, this should prevent a regression.

Steps to test

  1. Verify incorrect behavior on main:
    • pip install jupyter
    • Run python -c "import plotly.express as px; fig = px.scatter(x=[1], y=[1]); fig.show()". This SHOULD show a figure in the browser, but instead it prints the HTML/JS to the terminal output.
  2. Verify correct behavior on this branch:
    • Run python -c "import plotly.express as px; fig = px.scatter(x=[1], y=[1]); fig.show()" and make sure the figure is shown in the browser
  3. Make sure figure still renders correctly in Jupyter notebook:
    • This is a little tricky because Jupyter rendering seems to not play nicely with the local install (at least on my machine) and I'm not sure why yet. But it's not a problem introduced by this PR; the same is true on main.
    • For that reason I recommend downloading the build artifacts from the CI and installing the built wheel.
    • Run jupyter notebook to launch the notebook editor, and create a new notebook
    • Make sure the following code correctly renders a figure in the notebook:
import plotly.express as px
fig = px.scatter(x=[1], y=[1])
fig.show()

Copy link
Collaborator

@marthacryan marthacryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gvwilson gvwilson added P1 needed for current cycle fix fixes something broken labels Jul 3, 2025
Copy link
Contributor

I followed the test steps above and everything worked correctly (including the Jupyter notebook with a local package).

emilykl reacted with hooray emoji

@emilykl emilykl merged commit d2af541 into main Oct 1, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@marthacryan marthacryan marthacryan approved these changes

Labels

fix fixes something broken P1 needed for current cycle

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Default renderer is incorrect when ipython is installed in environment

AltStyle によって変換されたページ (->オリジナル) /