Python - Can't Import Pandas

Python - Can't Import Pandas

I get the same error whenever I want to run my code.

Traceback (most recent call last):
  File "paises.py", line 1, in <module>
    from pandas import DataFrame, Series
  File "/home/david/Documents/Projetos/Intro to Data Science/pandas.py", line 1, in <module>
    from pandas import DataFrame
ImportError: cannot import name DataFrame

My code is:

from pandas import DataFrame

Another Error:

Traceback (most recent call last): 
  File "knowingPandas.py", line 1, in <module>
    import pandas as pd
  File "/home/david/Documents/Projetos/Intro to Data Science/pandas.py", line 1
    adium-theme-ubuntu==0.3.4
                            ^   
SyntaxError: invalid syntax
5

1 Answer

The problem here was with the name of the file I was trying to run. I changed the name of pandas.py to pta.py.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett
Author

Chloe Bennett

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.