Mac 版 pycharm python代码“踩坑”记录一

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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值