import sys
import os
# 获取 路径
file_path = os.path.dirname(os.path.abspath(__file__))
# 修改运行路径
sys.path.append(file_path)
# 0 表示优先级,数字越大级别越低,修改模块的导入
sys.path.insert(0, os.path.dirname(file_path))
Python 解决CMD命令行终端无法import自定义依赖包问题
最新推荐文章于 2023-02-21 15:18:35 发布