RuntimeWarning: Parent module 'settings' not found while handling absolute import

来源:互联网 发布:淘宝店铺运营规划书 编辑:程序博客网 时间:2024/05/19 12:24

运行一个脚本,产生如下报错:

RuntimeWarning:Parent module 'settings' not found while handling absolute importimport os

检查代码逻辑,觉得没有问题。只好上网翻翻解决办法,查到这么一段:

就是用imp导入模块的时候,不要加 "点"。

Don't include a '.' after 'plugins', or Python will think it's a module path!

去掉点后, 问题解决。

0 0
原创粉丝点击