【问题标题】:ModuleNotFoundError: No module named 'pandas' (ubuntu)ModuleNotFoundError: 没有名为 \'pandas\' 的模块 (ubuntu)
【发布时间】:2023-02-09 02:37:36
【问题描述】:

我是ubuntu version 20.04 的新用户。

全新安装带有 python 3.8,所以我升级到最新的3.11

我照常做pip install pandas。 请注意,我也尝试使用pip3 installpandas 作为衡量标准。

创建一个包含以下内容的测试文件(称为test_pandas.py):

import pandas as pd

d = {'a':[1,2,3], 'b':[4,6,8]}
df = pd.Dataframe(d)
print(df)

运行文件:

python test_pandas.py

收到此错误消息:

ModuleNotFoundError: No module named 'pandas'

所以我用这个运行文件(对于 3.8 版本的 python):

python3 test_pandas.py

得到这个:

AttributeError: module 'pandas' has no attribute 'Dataframe'

我看过几个地方(最后是这个:https://pip.pypa.io/en/stable/installation/),但都失败了。

完全失去了做什么。 只需要3.11(最新版本)和相应的工作点。

我怎样才能做到这一点?

【问题讨论】:

    标签: python pandas dataframe ubuntu-20.04


    【解决方案1】:

    你有一个错字:它是DataFrame

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-06
      • 2020-09-02
      • 2018-05-16
      • 1970-01-01
      • 2019-02-13
      • 1970-01-01
      • 2019-04-12
      • 1970-01-01
      相关资源
      最近更新 更多