# Plotly in Spyder?

**URL:** <https://community.plotly.com/t/plotly-in-spyder/5414>\
**Category:** 📊 Plotly Python\
**Created:** [August 16, 2017, 8:13am UTC](https://community.plotly.com/t/plotly-in-spyder/5414 "2017-08-16T08:13:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![staticL](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@staticL](https://community.plotly.com/u/staticL)\
**Post date:** [August 16, 2017, 8:13am UTC](https://community.plotly.com/t/plotly-in-spyder/5414/1 "2017-08-16T08:13:39Z")

</div>

I’ve been learning how to use plotly in the Jupyter notebook but prefer working in Spyder. Where can I find resources on how to run Plotly from Spyder?

---

<div class="post-metadata">

**Author:** ![jmccarth10](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jmccarth10](https://community.plotly.com/u/jmccarth10)\
**Post date:** [August 30, 2017, 11:21pm UTC](https://community.plotly.com/t/plotly-in-spyder/5414/2 "2017-08-30T23:21:29Z")

</div>

Hi @staticL,

I just got it up and running on spyder 3.0 using the following steps. (windows 10)

1. Download plotly using pip usig command line (python -m pip install plotly) this requires downloading python 3.5 separately from Spyder as well. (so far I haven’t had any conflicts)
2. In Spyder, goto-\>Tools -\>PYTHONPATH Manager -\> addPath -\> insert path to Plotly library (mine was in python\python36-32\Lib\site-packages), then synchronize
3. Restart Spyder
4. test it out with import plotly.plotly \n import plotly.graph\_objs as go in a new .py scrypt

Hope it works out for you.  
Cheers

---

<div class="post-metadata">

**Author:** ![cnino](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@cnino](https://community.plotly.com/u/cnino)\
**Post date:** [November 12, 2018, 3:01pm UTC](https://community.plotly.com/t/plotly-in-spyder/5414/3 "2018-11-12T15:01:35Z")

</div>

I follow the process and spyder and anaconda stop working.

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [November 13, 2018, 10:55am UTC](https://community.plotly.com/t/plotly-in-spyder/5414/4 "2018-11-13T10:55:16Z")

</div>

Hi all,

To use plotly.py from Spyder, here’s what I would recommend:

1. Download and install the anaconda Python distribution: [https://www.anaconda.com/download/](https://www.anaconda.com/download/)
2. Install both Spyder and plotly.py using conda.

```auto
$ conda install -c plotly plotly spyder

```

1. Create plots from spyder using the `plotly.plotly.plot` (online) or `plotly.offline.plot` (offline) functions. Each of these will open the plots in your default web browser.
2. If you want static image export support, install the `plotly-orca` and `psutil` packages (See [https://github.com/plotly/plotly.py#static-image-export](https://github.com/plotly/plotly.py#static-image-export))

```auto
$ conda install -c plotly plotly-orca psutil

```

-Jon

---

<div class="post-metadata">

**Author:** ![nadersmn](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nadersmn](https://community.plotly.com/u/nadersmn)\
**Post date:** [November 18, 2018, 4:22pm UTC](https://community.plotly.com/t/plotly-in-spyder/5414/5 "2018-11-18T16:22:00Z")

</div>

I am still unable to run suggested solution provided by “jmmease”.  
Any help would be appreicated in showing step by step on how to get the graphs to run in Spyder Anaconda or have the graphs show in a browser by running the code in “spyder”  
Thank you

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [November 19, 2018, 10:42am UTC](https://community.plotly.com/t/plotly-in-spyder/5414/6 "2018-11-19T10:42:42Z")

</div>

Hi @nadersmn,

After you’ve installed the `plotly` package, try running this code from spyder

```python
from plotly.offline import plot
import plotly.graph_objs as go

fig = go.Figure(data=[go.Bar(y=[1, 3, 2])])
plot(fig, auto_open=True)

```

This should open up a bar chart in a new tab of your default browser.  
Hope that helps!  
-Jon

---

<div class="post-metadata">

**Author:** ![Jac0bMath3w](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jac0bMath3w](https://community.plotly.com/u/Jac0bMath3w)\
**Post date:** [March 24, 2020, 5:00am UTC](https://community.plotly.com/t/plotly-in-spyder/5414/7 "2020-03-24T05:00:58Z")

</div>

Hello Jon,

I am using spyder and I followed your instructions.  
in my terminal  
conda install -c plotly plotly spyder  
conda install -c plotly plotly-orca psutil

I imported the graph objects as follows

from plotly.offline import plot  
import plotly.graph\_objs as go

I get the following error when I try this code

fig = go.Figure([go.Scatter(x=combined[‘Date’], y=combined[‘confirmed’])])

TypeError: super(type, obj): obj must be an instance or subtype of type

Do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![skviknesh](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@skviknesh](https://community.plotly.com/u/skviknesh)\
**Post date:** [May 5, 2020, 11:32am UTC](https://community.plotly.com/t/plotly-in-spyder/5414/8 "2020-05-05T11:32:54Z")

</div>

Hi Jmmease, Using `Anaconda - Spyder 4.0.0 on Windows 10,`  
It really helped. I didn’t redo the entire installation, just inserting this piece of code extra- as you’ve mentioned above.

```auto
plot(fig, auto_open=True)

```

really worked for me.
