【发布时间】:2018-05-12 00:02:41
【问题描述】:
我的问题很简单。我已经用sudo pip3 install plotly 安装了它,但我无法导入它。我已经尝试重新安装它而没有效果。
ImportError Traceback (most recent call last)
<ipython-input-1-9d1f271208ac> in <module>()
----> 1 import plotly.plotly as py
2 import plotly.graph_objs as go
3 import pandas as pd
4 from pandas import Series,DataFrame
5 import numpy as np
ImportError: No module named 'plotly'
【问题讨论】:
-
你安装的是什么版本的 pip3,你运行的是什么版本的 Python?
-
添加相关的 PYTHONPATH 见here
-
只是为了确保:您安装了
sudo pip3 install plotly而不是您所写的情节,对吧? -
Indorman 感谢您的提示。我现在在 jupyter notebook 中工作,当安装在 bash 中时,不知何故有点“隐藏”了他。我刚刚使用我的“笔记本”环境在 PyCharm 中创建了一个新项目,并手动添加到解释器中。它解决了我的问题。