【发布时间】:2021-05-14 06:32:51
【问题描述】:
这里的例子
https://plotly.com/python/px-arguments/#plotly-express-works-with--long-wide-and-mixedform-data
数据导入只有一行:wide_df = px.data.medals_wide()
我通过 Anaconda 尝试了我的 Python 并得到了这个 Traceback: AttributeError: module ‘plotly.express.data’ has no attribute ‘medals_wide’
我刚试过这段代码:
for name in dir(px.data):
if '__' not in name:
print(name)
得到
absolute_import
carshare
election
election_geojson
gapminder
iris
tips
wind
根据结果我错过了一些数据,包括奖牌之一,然后我尝试在 Anaconda Prompt 下重新安装 Plotly 和 Plotly Express,但问题仍然存在
Successfully installed plotly-express-0.4.1
当我尝试pip install plotly 更新以防万一
我明白了
Requirement already satisfied: plotly in c:\users\ appdata\roaming\python\python37\site-packages (4.7.1)
Requirement already satisfied: retrying>=1.3.3 in c:\users\ appdata\roaming\python\python37\site-packages (from plotly) (1.3.3)
Requirement already satisfied: six in c:\users\\anaconda3\lib\site-packages (from plotly) (1.14.0)
谢谢
【问题讨论】:
-
你的 plotly 版本是什么?
-
不确定,刚刚更新了我的帖子以回复您的问题。这就是我尝试 pip install plotly 时得到的结果: 要求已经满足:在 c:\users\appdata\roaming\python\python37\site-packages (4.7.1) 中进行 plotly 要求已经满足:retrying>=1.3.3 in c:\users\ appdata\roaming\python\python37\site-packages (from plotly) (1.3.3) 要求已经满足:c:\users\\anaconda3\lib\site-packages 中的六个 (from plotly) (1.14 .0)
-
运行
import plotly,然后运行plotly.__version__ -
__version__末尾也有双下划线 -
4.7.1,我现在正在尝试“pip install plotly==4.14.3”,因为我的似乎不是最新版本
标签: python plotly plotly-express