问题
While I am importing the pandas in my data science project I am getting such kind of error. Does anyone know what might cause this?
I tried with re-installation of pandas and python also I also tried with wheel
import numpy as np
import pandas as pd
AttributeError
Traceback (most recent call last)
<ipython-input-2-b231533e2331> in <module>
1 import numpy as np
----> 2 import pandas as pd
3 from imblearn.over_sampling import SMOTE
4 from sklearn.model_selection import train_test_split
5 from sklearn.neighbors import KNeighborsClassifier
AttributeError: 'property' object has no attribute '__name__'
回答1:
"I got the solution for same. It may be multiple python version installation problem in same system problem so you need to create a virtual environment for your data science project now steps for creating virtual environment...."
1. install python 3.x
2. install pip
3. pip install virtualenv #for creating virtual environment
4. mkvirtualenv folder_name #command for creating virtual environment
5 pip install pandas # run this command in virtual environment directory
now import pandas it will work fine.
来源:https://stackoverflow.com/questions/56235417/attributeerror-property-object-has-no-attribute-name