Import error : No module named plotly.plotly

≯℡__Kan透↙ 提交于 2020-01-04 09:19:21

问题


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.


回答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



回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/46156123/import-error-no-module-named-plotly-plotly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!