skip to Main Content

Am a new user on ubuntu version 20.04.

The fresh install comes with python 3.8, so i upgrade to latest 3.11.

I do the usual pip install pandas.
Note i also try pip3 install pandas for good measure.

create a test file (called test_pandas.py) which contains this:

import pandas as pd

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

run file with:

python test_pandas.py

get this error message:

ModuleNotFoundError: No module named 'pandas'

so i run file with this (the for 3.8 version python):

python3 test_pandas.py

and get this:

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

I have looked in several places (finally this: https://pip.pypa.io/en/stable/installation/), but all fail.

totally lost as what to do.
just want 3.11 (latest version) with a corresponding working pip.

how can i achieve this ?

2

Answers


  1. You have a typo: it’s DataFrame.

    Login or Signup to reply.
  2. After some looking around, I noticed other Stack posts are suggesting you install wheel and then pandas. You could try that.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search