python:AttributeError:module 'xxx' has no arrtibute '__path__'

python执行文件有两种方式,python xxx.py 和 python -m xxx

今天执行python模块文件的时候报了标题的错误。

原因是执行 python -m aaa.bbb.ccc.py 多加了.py这个后缀名。

使用python -m 的时候不要加后缀。

猜你喜欢

转载自blog.csdn.net/ynshi57/article/details/105949144