-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.0.0b4] poetry run fails with FileNotFoundError #1567
Comments
Me also getting this error with the |
I also getting this error after renaming the parent dir. |
Can you give a little bit more feedback on how did you resolve the issue? You removed the |
I'm sorry. I was mistaken. |
I just solved my problem. I used for reference this issue #1198. |
Same problem here using
results in
while Related to #2741. |
I have this issue too.
|
it would be awfully nice if poetry told you to run |
I'm getting this error even after I run Steps to reproduce:
Something I notice is that poetry can't run my program but using python directly can:
EDIT: Oh wait, I'm just stupid. I misunderstood how to use the
|
were you able to circumvent this problem? |
This was immensely helpful. I'd misread the instructions too |
I have a similar error: $ poetry run --no-ansi echo "hello"
FileNotFoundError
[Errno 2] No such file or directory
at /usr/local/lib/python3.8/os.py:601 in _execvpe
597│ path_list = map(fsencode, path_list)
598│ for dir in path_list:
599│ fullname = path.join(dir, file)
600│ try:
→ 601│ exec_func(fullname, *argrest)
602│ except (FileNotFoundError, NotADirectoryError) as e:
603│ last_exc = e
604│ except OSError as e:
605│ last_exc = e or $ poetry --no-ansi run echo "hello"
USAGE
poetry help [<command1>] ... [<commandN>]
ARGUMENTS
<command> The command name
GLOBAL OPTIONS
-h (--help) Display this help message
-q (--quiet) Do not output any message
-v (--verbose) Increase the verbosity of messages: "-v" for normal output, "-vv" for more verbose output and "-vvv" for debug
-V (--version) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n (--no-interaction) Do not ask any interactive question vs. $ poetry run echo "hello"
hello According to the help, I can use $ poetry help run
USAGE
poetry run <args1> ... [<argsN>]
ARGUMENTS
<args> The command and arguments/options to run.
GLOBAL OPTIONS
-h (--help) Display this help message
-q (--quiet) Do not output any message
-v (--verbose) Increase the verbosity of messages: "-v" for normal output, "-vv" for more verbose output and "-vvv" for debug
-V (--version) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n (--no-interaction) Do not ask any interactive question Edit: some information on my system:
|
I get this error if I haven't properly added / installed a package within poetry. But the error is especially baffling in my case, because the directory it is trying to read from shouldn't be python related at all: Below is some slightly censored output (just the file path censored) for if I run
I have no idea why poetry wants to look in the folder in which I installed godot, but it does, every time. Similarly:
System: ubuntu 20.04 |
I have the same issue as above, it tries to look to the Golang binaries to run Python program. |
I have this same issue but it is looking for Perl binaries... root@alatham <path to poetry project> (<virtualenv-name>) # poetry run
FileNotFoundError
[Errno 2] No such file or directory: b'/usr/bin/core_perl/run'
at /usr/lib/python3.10/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 Note that I'm running from WSL2 on Arch Linux. |
Had the same problem, |
In terms of the error message, it is raised during the call to I think that the output of
which is kind of result you'd expect in this situation. I've looked into this a little and am not sure on the implementation details, but will create a PR if I come up with something I'm satisfied with. |
Some of the UX issues around $ poetry --version
Poetry (version 1.2.0a2)
$ poetry run
Not enough arguments (missing: "args")
$ poetry run --help
Description:
Runs a command in the appropriate environment.
...
$ poetry run -vvv echo test
Loading configuration file /Users/Branch/Library/Application Support/pypoetry/config.toml
Using virtualenv: /Users/Branch/Code/python-poetry/poetry/.venv
test I've filed #5243 to address the remaining cryptic |
Just got bit by this. In my case, I'd forgotten to run |
Still having this issue in version 1.1.3
|
@1player that's not really a lot to work with. That might very well be something specific to your usage. Can you make a repo with the minimum reproducible case for your problem? |
I literally just created a new repo with |
Indeed. Here's how I repro'ed it: cd $(mktemp -d)
cat - > Dockerfile <<EOF
FROM archlinux
RUN pacman -Syyu --noconfirm python \
&& mkdir /code
WORKDIR /code
RUN (curl -sSL https://install.python-poetry.org | python3 -) \
&& /root/.local/bin/poetry init -n
EOF
# This takes a little while, give it time.
docker run --rm $(docker build -q .) /root/.local/bin/poetry run |
On more recent versions of poetry you will see this:
which is a more helpful error message |
no, I don't know where this changed. Try with the latest beta 1.2.0b2. |
Using |
you have to add on you're pyproject.toml, this script: |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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).poetry run -vvv
does not change anything about the outputOS version and name: Linux x86_64 (Elementary OS)
Poetry version: 1.0.0b4
Link of a Gist with the contents of your pyproject.toml file: Link (generated with
poetry new
)Issue
Running
poetry run
without additional argument fails withExecuting
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.The text was updated successfully, but these errors were encountered: