在我的电脑中pycharm这样显示:
ImportError: cannot import name 'XGBClassifier' from 'xgboost' (E:\pycharm_files\graduation\xgboost.py)
原因:自己命名的.py为xgboost.py这个与xgboost中的库文件命名冲突,所以自己不要以xgboost.py对脚本进行命名。
在我的电脑中pycharm这样显示:
ImportError: cannot import name 'XGBClassifier' from 'xgboost' (E:\pycharm_files\graduation\xgboost.py)
原因:自己命名的.py为xgboost.py这个与xgboost中的库文件命名冲突,所以自己不要以xgboost.py对脚本进行命名。