将包添加到标准路径,以便导入模块 临时添加: import sys sys.path.append('D:/XXX') 永久添加: python的site-packages目录"xxx.pth"文件,将路径 'D:/YYY' 写入文件中