无法使用.bat文件激活虚拟环境
突然的任务调度程序都停止了工作。 挖掘详细信息,由于某种原因,批处理文件似乎没有激活虚拟环境。
Manually running the below command in powershell works fine.
.\.venv\Scripts\Activate.ps1
但是,手动运行.bat文件给我“ ModulenotFoundError”错误,因为VENV没有被激活。
set OdenImports=OdenImports
start "C:\Users\path\MyReports\.venv\Scripts\python.exe" && "C:\Users\path\MyReports\main.py" %1 %OdenImports%
为什么突然它停止工作,我该如何修复?
All of the sudden task scheduler stopped working.
Digging into details, seems like batch file is not activating virtual environment for some reason.
Manually running the below command in powershell works fine.
.\.venv\Scripts\Activate.ps1
However, manually running .bat file gives me "ModuleNotFoundError" error, because venv is not activated.
set OdenImports=OdenImports
start "C:\Users\path\MyReports\.venv\Scripts\python.exe" && "C:\Users\path\MyReports\main.py" %1 %OdenImports%
Why all of the sudden it stopped working and how can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论