poetry run causes [FileNotFoundError] with some scripts
See original GitHub issue- 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).
- OS version and name: Windows 10 Enterprise
- Poetry version: Poetry version 1.0.5
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/huwper/efb95344f986939bf4fd717fbeb64a91
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
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
poetry run tox FileNotFoundError - python - Stack Overflow
Since tox was listed under the [tool. poetry. dev-dependencies] section of my pyproject. toml file, it wasn't automatically added.
Read more >No Such File Or Directory: Python - avvocatopollara.it
Filenotfounderror Errno 2 no such file or directory is a python error ... We can run the following script to solve the error...
Read more >[SOLVED] Python filenotfounderror - A Quick Guide - AskPython
It is a system message that the compiler throws when you are trying to execute a command that requires a file that the...
Read more >Configure a Poetry environment | PyCharm Documentation
Poetry is a tool that facilitates creating a Python virtual environment based on the project dependencies. You can declare the libraries your project ......
Read more >poetry install [errno 2] no such file or directory: 'python'
You'll find specifying an alias for python to python3 won't work ( unless, perhaps you specify this in your bashrc instead of any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think this is also a duplicate of #3265 which I have this PR up to fix: #3339
@sinoroc Yes, I think these are all the same issue. I have a question: what’s then intention behind
env.py
’s_bin(bin)
method? I inferred that it’s to check Poetry’s virtualenv first (that’s what the code sure is doing by looking atself._bin_dir / bin
first, and only falling back tobin
if nothing was found inself._bin_dir
). If this is indeed the case, that lends credence to my recommendation I made here: https://github.com/python-poetry/poetry/pull/3395#issuecomment-732546336@kevincon @huwper Can you both take a look and confirm? I definitely borrowed from both your PR’s and am happy to go change the authorship. In fact, let me go do that! This was definitely a joint effort.