Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Plotly for Python 3 Jupyter Notebook?

Tags:

python

plotly

I'm a total beginner and I have a problem installing plotly to use it in my Jupyter Notebook. I have installed the Python 3 version. I am also using a Mac if that matters. I tried a variety of commands in the terminal but none of them worked.

This is my command in Jupyter Notebook:

from plotly import __version__
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot

print(__version__) # requires version >= 1.9.0

This is the error I get:

ModuleNotFoundError: No module named 'plotly'

I would really appreciate some help! Thanks in advance. Desperate beginner

like image 573
Nicki Avatar asked Jan 22 '19 21:01

Nicki


People also ask

How do I install plotly in Python?

To install the package, open up terminal and type $ pip install plotly or $ sudo pip install plotly . Plotly's graphs are hosted using an online web service, so you'll first have to setup a free account online to store your plots. To retrieve your personal API key, follow the link here: https://plot.ly/settings/api#/.

How install plotly VS code?

You need to make sure to run the app in the same env as where you installed plotly. if you can run your code manually in terminal in VS Code - python script.py - then you can also run python -m pip install plotly to install modules in this Python.

Is plotly a library or package?

Plotly is a free and open-source graphing library for R. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials.


2 Answers

Download whl file: https://files.pythonhosted.org/packages/3e/77/905effe9361395d3e094ffd2b54b4085d339a7b7de9c2c91fa55ec257422/plotly-3.5.0-py2.py3-none-any.whl

use pip install C:\Users\Downloads\plotly-3.5.0-py2.py3-none-any.whl

like image 130
S.Gu Avatar answered Sep 28 '22 04:09

S.Gu


I have now solved the problem. I just opened a new Terminal and made sure that I wrote the command

pip install cufflinks

directly after the second line.

The same worked for

pip install plotly

enter image description here

like image 43
Nicki Avatar answered Sep 28 '22 06:09

Nicki