Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: 'No module named plotly.plotly' in LinuxMint17.3

Tags:

I am New in Python. Whenever I am trying to compile the following code to get a line graph shows some errors. But I don't know how to fix it. Here is my code :

import plotly.plotly as py import plotly.graph_objs as go  # Create random data with numpy import numpy as np  N = 500 random_x = np.linspace(0, 1, N) random_y = np.random.randn(N)  # Create a trace  trace = go.Scatter( x = random_x, y = random_y )  data = [trace]   py.iplot(data, filename='basic-line') 

Shows the following error :

mks@mks-H81M-S /media/mks/KUTUBUDDIN1/test $ python datdaPlot.py  Traceback (most recent call last):   File "datdaPlot.py", line 1, in <module>     import plotly.plotly as py  ImportError: No module named plotly.plotly  mks@mks-H81M-S /media/mks/KUTUBUDDIN1/test $    

Please help to fix this. Thanks in advance.

Added:
According to Spandan Brahmbhatt, I have installed pip by sudo pip install plotly. But still shows the following error:

enter image description here

like image 775
Primo Avatar asked Mar 01 '17 01:03

Primo


People also ask

How do I download Plotly in Python?

We can access this API in python using the plot.ly package. 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.

How install Plotly Express in Terminal?

Via pip. Just running pip install plotly_express==0.4. 0 in your terminal should do it!


1 Answers

You will need to install them first.

pip install plotly pip install cufflinks 
like image 62
Mudit Gupta Avatar answered Oct 07 '22 17:10

Mudit Gupta