Ask questions[1.0.0b4] poetry run fails with FileNotFoundError
[x] I am on the latest Poetry version.
[x] I have searched the issues of this repo and believe that this is not a duplicate.
[x] If an exception occurs when executing a command, I executed it again in debug mode (
poetry run -vvv does not change anything about the output
OS version and name: Linux x86_64 (Elementary OS)
Poetry version: 1.0.0b4
poetry run without additional argument fails with
[FileNotFoundError] [Errno 2] No such file or directory
poetry run pip list for example works fine. It's just with either no argument or when the first argument is not found as an executable.
Answer questions mattwelke
I'm getting this error even after I run
Steps to reproduce:
poetry run app.py.
Something I notice is that poetry can't run my program but using python directly can:
poetry run app.py FileNotFoundError [Errno 2] No such file or directory at ~/.pyenv/versions/3.9.1/lib/python3.9/os.py:607 in _execvpe 603│ path_list = map(fsencode, path_list) 604│ for dir in path_list: 605│ fullname = path.join(dir, file) 606│ try: → 607│ exec_func(fullname, *argrest) 608│ except (FileNotFoundError, NotADirectoryError) as e: 609│ last_exc = e 610│ except OSError as e: 611│ last_exc = e
python app.py hello
Oh wait, I'm just stupid. I misunderstood how to use the
poetry run command. Checking the docs helped me:
poetry run python app.py hello