1.异常现象:
python 项目路径:D:\pythonrun\processdata
tablejob是processdata的子文件夹
pycharm运行run.py正常,控制台cmd启动run.py程序报错:"no module named tablejob"
2.原因分析:
未添加项目路径到PYTHONPATH
3.解决方案:
# 激活虚拟环境
conda activate python38
# 进入盘符 D:
# 进入项目文件夹 cd D:\pythonrun\processdata
# 设定PYTHONPATH
set PYTHONPATH=D:\pythonrun\processdata
# 启动项目
python tablejob\***\run.py
标签:named,cmd,processdata,py,module,pythonrun,报错 From: https://www.cnblogs.com/yellow3gold/p/18675673