AttributeError: module ‘pandas‘ has no attribute ‘read_csv‘

In the process of using Jupyter to learn TensorFlow, this problem arises.

It should be because of an error that occurred when I downloaded the seaborn package two days ago, and the seaborn package can be used normally. But at the beginning, I found that there was a problem with importing the matplotlib package. I uninstalled it and downloaded it again.

Then it appeared, AttributeError: module 'pandas' has no attribute 'read_csv'

The package can be imported normally, but cannot be used. I searched and found that everyone is caused by the duplicate name of the csv.py or pandas.py file.

But I don't have these operations.

My solution is,

I found the location of the package in my virtual environment, checked whether the pands package was normal, and found that there was only one lib folder in the pandas package , which felt wrong, so I found another pands package that could be used, and compared it, it was found that the content similar to the picture below was correct.

So, I uninstalled and redownloaded, and it worked fine.

While the solution is simple, hopefully we can still find out why this is happening.

Guess you like

Origin blog.csdn.net/TTritium/article/details/122621361