我自己新建了一个python包,名字:base,在其他的文件中想要使用这个包,就得像下面这样import进来
from base.run_method import RunMethod
解决方法:
进入 python 运行环境
import sys
import os
curPath = os.path.abspath(os.path.dirname(file))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
python 命令运行环境下 ModuleNotFoundError: No module named ‘Base‘
最新推荐文章于 2024-06-25 20:48:19 发布