import optuna报错AttributeError: module 'optuna' has no attribute 'logging'

问题遇到的现象和发生背景

import optuna一直显示AttributeError: module 'optuna' has no attribute 'logging'

问题相关代码,请勿粘贴截图

img

import optuna
from optuna.integration import LightGBMPruningCallback
from sklearn.model_selection import StratifiedKFold,KFold
import lightgbm as lgbm

运行结果及报错内容

AttributeError: module 'optuna' has no attribute 'logging'

我的解答思路和尝试过的方法

上网搜索很多说是指向了同名文件,类似于optuna.py这种的,但是我已经查过了,并没有这个文件,不知道怎么回事呜呜呜

img

img

你自己运行得这个python文件名字是什么,可能文件名起了冲突