Skip to content

poetry run causes [FileNotFoundError] with some scripts #2481

@huwper

Description

@huwper
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

Using poetry run to run scripts fails on some scripts. I think this is probably in cases where the script has no file extension. The linked pyproject.toml installs scons into the virtual environment. Scons comes with a script called scons which is installed in the Scripts directory. The following error occurs when running the script:

c:\Projects\personal\poetry-scons-issue>poetry run scons

[FileNotFoundError]
[WinError 2] The system cannot find the file specified

Running poetry venv info to get path/to/venv and running scons with the explicit path works fine

> path\to\venv\Scripts\scons

scons: *** No SConstruct file found.
......

scons also comes with a script called scons.bat which does the same thing. poetry run scons.bat does work

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions