# Plotly not loading in browser

**URL:** https://community.plotly.com/t/plotly-not-loading-in-browser/39108
**Category:** 📊 Plotly Python
**Created:** [May 8, 2020, 2:49pm UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108 "2020-05-08T14:49:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![etjkai](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@etjkai](https://community.plotly.com/u/etjkai)
#### Post date: [May 8, 2020, 2:49pm UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108/1 "2020-05-08T14:49:45Z")

</div>

I know there is a similar thread over [here](https://community.plotly.com/t/plotly-doesnt-load-most-of-the-time/32095/12), but I have not managed to find any solutions within.

When I try to run some of the example Plotly code, the page never seems to load for me.

For instance, I run the below in VSCode

```auto
import plotly.express as px
data_canada = px.data.gapminder().query("country == 'Canada'")
fig = px.bar(data_canada, x='year', y='pop')
fig.show()

```

Every instance of me running opens the localhost with a different port, and the page never successfully loads.

e.g. [http://127.0.0.1:56840/](http://127.0.0.1:56840/) , [http://127.0.0.1:56887/](http://127.0.0.1:56887/)

It’s only when I write to html, with the below code, does it appear as intended.

```auto
import plotly.graph_objects as go
fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
fig.write_html('first_figure.html', auto_open=True)

```

Is there anyway to use [fig.show](https://fig.show/)() as described in the documentation?

---

<div class="post-metadata">

### Author: ![joseph.damiba](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@joseph.damiba](https://community.plotly.com/u/joseph.damiba)
#### Post date: [May 8, 2020, 6:25pm UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108/2 "2020-05-08T18:25:37Z")

</div>

Hi @etjkai, and thanks for using the community forum!

What web browser are you trying to use? Do you have any extensions which prevent JavaScript from executing?

Do you have the same issues displaying figures if you try to run a Jupyter Notebook in that same browser?

I would also recommend taking a look at [https://plotly.com/python/renderers/](https://plotly.com/python/renderers/). Maybe your default renderer is not set to `browser`?

---

<div class="post-metadata">

### Author: ![etjkai](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@etjkai](https://community.plotly.com/u/etjkai)
#### Post date: [May 8, 2020, 6:40pm UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108/3 "2020-05-08T18:40:35Z")

</div>

Hi Joseph, thanks for trying to help me!

I’m using Chrome. I do not have any extensions that prevent JavaScript. (`write_html` method works just perfectly)

There’s no trouble running it in Jupyter Notebook (I use the Python Interactive Jupyter Server, in VS Code).  
My `pio.renderers.default` return “browser”

The last time I worked with plotly, I don’t recall it having the 5 digit port number at the end of the localhost, is it supposed to be there?

EDIT: I have also turned off my firewall temporarily, to no avail.

---

<div class="post-metadata">

### Author: ![joseph.damiba](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@joseph.damiba](https://community.plotly.com/u/joseph.damiba)
#### Post date: [May 8, 2020, 7:00pm UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108/4 "2020-05-08T19:00:55Z")

</div>

As far as seeing the port number is concerned, yes, that is normal. `plotly.py` uses a port to communicate the information about your figure to the browser.

Does your issue only occur in Chrome or does it persist in other web browsers? For example, if you change your default browser to Firefox and then run `fig.show()`, are you able to view your figure?

---

<div class="post-metadata">

### Author: ![etjkai](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@etjkai](https://community.plotly.com/u/etjkai)
#### Post date: [May 9, 2020, 4:27am UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108/5 "2020-05-09T04:27:27Z")

</div>

Okay I’ve tried, and embarrassingly it works with firefox, and on chrome on another computer.

How can I troubleshoot what is going wrong with Chrome on this computer? AFAIK I do not have any add-ons / extensions that stop JavaScript - It’s the same chrome account on two computers.

Javascript is enabled on my Chrome browser - [https://i.imgur.com/4guu6Md.png](https://i.imgur.com/4guu6Md.png)

Not sure if it’s pertinent info, but it doesn’t always not work. Sometimes, it loads well for two tries, then stops during future runs.

---

<div class="post-metadata">

### Author: ![drbmc](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@drbmc](https://community.plotly.com/u/drbmc)
#### Post date: [June 2, 2021, 7:17pm UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108/6 "2021-06-02T19:17:19Z")

</div>

I am receiving a similar error. I cannot get the image to recognize using Firefox in a Windows10 browser. Oddly, I am able to run successfully using a localhost jupyter notebook on Firefox in Ubuntu 20.04 VM.

---

<div class="post-metadata">

### Author: ![kellenc](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kellenc](https://community.plotly.com/u/kellenc)
#### Post date: [January 21, 2025, 9:56pm UTC](https://community.plotly.com/t/plotly-not-loading-in-browser/39108/8 "2025-01-21T21:56:55Z")

</div>

I had the same issue in Edge and I think I was able to fix it. I discovered that if I clicked the URL and hit enter while it was trying to load, it would immediately load. This seems to indicate that Edge was interrupting the rendering process with something else.  
In “Cookies and site data” settings, toggle off “Preload pages for faster browsing …”  
Cleared it right up for me.
