[英]Poetry on Windows in a batch file
I am trying to write a script for starting my python app on windows.我正在尝试编写一个脚本来在 Windows 上启动我的 python 应用程序。 The app manages its dependencies using poetry.该应用程序使用诗歌管理其依赖项。 I tried a few things, including:我尝试了几件事,包括:
call "poetry" run pack_one/one.py
and和
poetry run pack_one/one.py
However, I always get this error:但是,我总是收到此错误:
OSError
[WinError 193] %1 is not a valid Win32 application
at ~\.pyenv\pyenv-win\versions\3.7.9\lib\subprocess.py:1207 in _execute_child
What am I doing wrong?我究竟做错了什么?
just do做就是了
poetry run python /path/to/script
poetry run
tries to execute an executable inside the poetry venv (but not run a python script) poetry run
尝试在诗歌 venv 中执行一个可执行文件(但不运行 python 脚本)
you could also do poetry shell
first to enter the virtual env and then just python /path/to/script
你也可以先做poetry shell
进入虚拟环境,然后只是python /path/to/script
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.