AttributeError:“属性"对象没有属性"__name__" [英] AttributeError: 'property' object has no attribute '__name__'
问题描述
当我在数据科学项目中导入大熊猫时,我遇到了这样的错误.有人知道这可能是什么原因吗?
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?
我尝试重新安装pandas和python 我也尝试过滚轮
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__'
推荐答案
我已经获得了相同的解决方案.同一系统问题中可能是多个python版本安装问题,因此您需要为数据科学项目创建虚拟环境现在创建虚拟环境的步骤....
"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.
这篇关于AttributeError:“属性"对象没有属性"__name__"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!