pycharm版本:2019.3.3 Mac 专业版
pycharm调试python代码出现了一个“奇葩”的错误,代码节选如下:第四行代码“from config.setting import config ”中,“config”显示红色波浪线
import unittest import ddt from xxx_xx_x.common.excel_handler import ExcelHandler from xxx_xx_x.config.setting import config
@ddt.ddt class TestRegister(unittest.TestCase): # 读取数据 excel_handler = ExcelHandler(config.data_path) data = excel_handler.read('register') @ddt.data def test_register(self, test_data): print(test_data)
右键运行该段代码出现如下错误:ModuleNotFoundError: No module named 'xxx_xx_x
'
改动后代码如下:第四行代码“from config.setting import config ”中,“config”依旧显示红色波浪线
import unittest import ddt from common.excel_handler import ExcelHandler from config.setting import confi