2

I am working on project and getting this error

ImportError: No module named plotly.plotly

I tried:

  1. pip install plotly
  2. pip install --upgrade plotly

But import plotly.plotly as py didn't work.

6
  • there is nothing coded , i just install plotly and then "import plotly.plotly as py" didn't work Commented Sep 11, 2017 at 12:48
  • 1
    You've installed plotly somewhere where your python environment can't see it, what does pip show plotly show? if it's installed it will show the installed directory, where are you running python from? Commented Sep 11, 2017 at 12:51
  • this is the path "c:\pyzo2015a\lib\site-packages" and i have included this in environment variable . and i am using windows 7 and pyzo platform Commented Sep 11, 2017 at 13:01
  • Never used that but the docs state you're supposed to just install cmd: pyzo.org/start.html#step-3-install-scientific-packages. does install plotly work? Have you tried restarting your environment? Personally I'd just use anaconda as it just works Commented Sep 11, 2017 at 13:02
  • Make sure the path of the module is in your sys.path Commented Sep 11, 2017 at 13:03

3 Answers 3

1

Not sure if pyzo and python modules are stored at different location on your computer. And how they are referred.

But you can try following to give absolute path name for plotly while loading module and see if it works.

import sys
sys.path.insert(0, 'c:\\pyzo2015a\\lib\\site-packages\\plotly')
import plotly.plotly as py
Sign up to request clarification or add additional context in comments.

Comments

1

I had the same exact problem, but the current answer did not resolve my issues. If that's the case, here is an alternative (IDE dependent):

I was not having success with the "pip" stuff. I am using PyCharm, and the following simple steps took care of my problems in less than 30 seconds.

  1. Settings
  2. Click Project: "MyProjectHere" in left hand nav menu
  3. Select Project Interpreter from the above drop down
  4. Find the green 'plus' sign near the upper right edge of the window that comes up.
  5. Type Plotly in the search bar
  6. Click install.

Maybe one day I won't be a dumb monkey who doesn't know how to use a command line like all the cool kids, but for now this worked for me.

1 Comment

Based answer. Worked for me.
0

I had the same problem installing plotly with pip and then import not being able to find it, but it worked when I used conda, instead.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.