Jenkins运行识别不到自定义的包

作者:Gakki

Jenkins运行识别不到自定义的包 ModuleNotFoundError: No module named “common”

  • 将下面的代码添加到要运行的 py 文件最前面就可以了。
import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.abspath(os.path.dirname(curPath) + os.path.sep + ".")
sys.path.append(rootPath)

你可能感兴趣的:(Jenkins运行识别不到自定义的包)