找不到模块错误:没有名为“ chart_studio”的模块

时间:2020-04-15 15:51:54

标签: python pip jupyter-notebook plotly

我在jupyter笔记本中运行!pip install chart_studio

然后在运行此代码时:

import numpy as np
import pandas as pd

import cufflinks as cf
import chart_studio.plotly as py

from chart_studio.plotly import iplot

import plotly.graph_objects as go
chart_studio.tools.set_credentials_file(username=xx, api_key = xxx)

我回来了:

No module named 'chart_studio'

我尝试过语法更正,但没有任何乐趣。有什么建议吗?

5 个答案:

答案 0 :(得分:3)

在当前环境中只是conv

答案 1 :(得分:1)

使用conda进行安装:

conda install -c plotly chart-studio

答案 2 :(得分:0)

MessageComposer

在上面的行中,您已将chart_studio导入为py。因此,

import chart_studio.plotly as py

在这一行中,您需要通过别名调用

chart_studio.tools.set_credentials_file(username=xx, api_key = xxx)

否则,您只需导入chart_studio.plotly并直接使用即可。 如有任何疑问,请发表评论。

答案 3 :(得分:0)

模块chart_studio不再是plotly软件包的模块。您需要安装chart-studio软件包

https://pypi.org/project/chart-studio/

答案 4 :(得分:0)

是的,它适用于:

pip install chart-studio