1

I am trying to write a script for starting my python app on windows. 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?

Ibolit
  • 9,218
  • 7
  • 52
  • 96
  • Possibly addressed [here](https://stackoverflow.com/questions/25651990/oserror-winerror-193-1-is-not-a-valid-win32-application)? – 0x263A Jul 23 '21 at 07:47

1 Answers1

4

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)

you could also do poetry shell first to enter the virtual env and then just python /path/to/script

Joran Beasley
  • 110,522
  • 12
  • 160
  • 179