小编Tan*_*y.L的帖子

AttributeError: 模块 'pandas' 没有带有 rapsberry Pi 的属性 'Dataframe'

我知道有类似的问题,但没有人能够为我提供答案。我正在树莓派(模型 3)上运行 python 脚本。我正在使用 python 3,并且通过 pip install pandas 安装了 pandas。我的代码能够运行该行import pandas as pd,但test = pd.Dataframe给了我一个错误:AttributeError: module 'pandas' has no attribute 'Dataframe'

如下面的代码所示,我检查了我的代码是否有一个合适的 pandas 模块。

我也直接在python中检查:

`Python 3.7.3 (default, Apr  3 2019, 05:39:12)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
Run Code Online (Sandbox Code Playgroud)

这工作正常:

>>> test = pd.Dataframe()
Run Code Online (Sandbox Code Playgroud)

但这给了我以下错误消息:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.7/site-packages/pandas/__init__.py", line 214, in __getattr__
raise …
Run Code Online (Sandbox Code Playgroud)

python pandas raspberry-pi3

1
推荐指数
1
解决办法
7514
查看次数

标签 统计

pandas ×1

python ×1

raspberry-pi3 ×1