module 'pandas' has no attribute 'read_csv

Make sure you don't have a file called pandas.py in the directory you are executing your python file in.


I had checked for the presence of csv.py and made sure there was no file of this name. I also tried pip uninstall pandas and then pip install pandas. I still got the same error.

What worked for me was: pip-autoremove.

First install it using pip install pip-autoremove.
Then, remove pandas using pip-autoremove pandas -y.
Next, reinstall it using pip install pandas.

The reason why this is necessary is that sometimes, when using uninstall, the package folder may still be present.


Try renaming your csv.py to something else, like csv_test.py. Looks like pandas is being confused about what to import.

Tags:

Python

Csv

Numpy