出现module 'xgboost' has no attribute 'DMatrix'的临时解决方法
来源:互联网 发布:查询淘宝账号安全 编辑:程序博客网 时间:2024/06/06 17:51
最近刚刚开始使用xgboost,安装神马的都没问题。用了几天之后突然出现这样的问题:
我是想尽了办法,各种重装,最后终于还是没成,,,,,
看到网上有一个办法:
重新新建Python文件,把你的代码拷过去;或者重命名也可以;还不行,就把代码复制到别的地方(不能在原始文件夹内),会重新编译,就正常了
但是我觉得本质问题不是这样解决的,但临时应急还是可以的,欢迎讨论!
更新:
问题根源:
初学者或者说不太了解Python才会犯这种错误,其实只需要注意一点!不要使用任何模块名作为文件名,任何类型的文件都不可以!我的错误根源是在文件夹中使用xgboost.*的文件名,当import xgboost时会首先在当前文件中查找,才会出现这样的问题。
所以,再次强调:不要用任何的模块名作为文件名!
2 0
- 出现module 'xgboost' has no attribute 'DMatrix'的临时解决方法
- 【Python学习】python不要使用任何模块名作为文件名(module 'xgboost' has no attribute 'DMatrix')
- xgboost异常AttributeError: 'DMatrix' object has no attribute 'handle'
- Python2.7 安装mock出现AttributeError: 'module' object has no attribute的解决方法
- Python3.x中出现 "AttributeError: module 'urllib' has no attribute 'urlopen'" 的解决方法
- 当安装好Xgboost后当调用其函数出现``` AttributeError: module 'xgboost' has no attribute 'feature_importance_'
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- AttributeError: 'module' object has no attribute 的解决方法
- TensorFlow问题 :AttributeError: module 'tensorflow' has no attribute 'sub'问题出现原因及解决方法
- yum错误'module' object has no attribute 'iterparse'解决方法
- AttributeError: 'module' object has no attribute 'Frame' 解决方法
- AttributeError: 'module' object has no attribute 'Frame' 解决方法
- Python基础学习-'module' object has no attribute 'urlopen'解决方法
- 解决方法——AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- Scrapy AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1 解决方法
- 出现错误如下:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
- hdu 4686 Arc of Dream【矩阵快速幂】
- 如何修改Android Studio中默认生成的注释信息
- UITableView contentInset注解
- C#键值对集合
- ListView的addHeaderView和setAdapter的调用顺序
- 出现module 'xgboost' has no attribute 'DMatrix'的临时解决方法
- Server.Htmlencode和Server.HtmlDecode的用法
- Ubuntu Firefox 安装flash插件
- java 枚举类总结
- mysql查询今天、昨天、近7天、近30天、本月、上一月的SQL语句
- 对Github上一个开源项目图片选择器的分析
- 关于《竹林蹊径 深入浅出Windows驱动开发》第一个例子在Win7下蓝屏
- Android Studio导入第三方类库的方法
- Qt 5.6.0 动态编译(VS2013 x86 target xp openssl icu webkit)