/bin/sh: poetry: not found
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: Docker python:3.6.5-alpine3 via macOS 10.14
- Poetry version: master
- Link of a Gist with the contents of your pyproject.toml file:
Issue
Hi there,
Today a Docker container which houses an NLP training platform broke. It seems the issue is that Poetry isn’t being installed properly into the container during the container build phase. I don’t see any problems until I try to use the Poetry executable.
Here’s some output from the Docker build:
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
$HOME/.poetry/bin
This path will then be added to your `PATH` environment variable by
modifying the profile file located at:
$HOME/.profile
You can uninstall at any time with `poetry self:uninstall`,
or by executing this script with the --uninstall option,
and these changes will be reverted.
Installing version: 0.12.2
- Downloading poetry-0.12.2-linux.tar.gz (8.53MB)
Poetry (0.12.2) is installed now. Great!
To get started you need Poetry's bin directory ($HOME/.poetry/bin) in your `PATH`
environment variable. Next time you log in this will be done
automatically.
To configure your current shell run `source $HOME/.poetry/env`
...
Step 8/15 : WORKDIR /app
---> Running in b3131b487bb2
Removing intermediate container b3131b487bb2
---> 8bab84b160e7
Step 9/15 : COPY pyproject.lock pyproject.toml /app/
---> f9a9ecb5af2d
Step 10/15 : RUN poetry update && poetry install
---> Running in 02c7de951592
/bin/sh: poetry: not found
The command '/bin/sh -c poetry update && poetry install' returned a non-zero code: 127
As recently as a few days ago this container built without any issue.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Poetry installed but `poetry: command not found`
When I run this, after shutdown of bash Terminal: export PATH="$HOME/.poetry/bin:$PATH". poetry command is then recognised.
Read more >Getting started — timezonefinder /bin/sh: 1: poetry
All available features of this package are explained HERE. Examples for common use cases can be found HERE. ... Built with Sphinx using...
Read more >executor failed running [/bin/sh -c poetry install --no-dev]: exit ...
First error is fixed as you found out by adjusting your system clock. Second error is due to the fact that pip is...
Read more >duffn/python-poetry:3.10-slim-1.1.12-2022-01-21 | Docker Hub
/bin/sh -c set -eux; apt-get. 1.03 MB. 6. ENV GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D. 0 B. 7. ENV PYTHON_VERSION=3.10.2.
Read more >Poetry installation fails on Ubuntu - command line
poetry /bin . Regarding python is not available, you can (re)install python-is-python3 package via apt :
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 FreeTop 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
Top GitHub Comments
Do you execute
source $HOME/.poetry/env
before callingpoetry
?This has come up in other issues. The simplest way to “fix” it is to call poetry with
$HOME/.poetry/bin/poetry
. You can also doENV PATH="${PATH}:/root/.poetry/bin"
and then call poetry normally.Both of those are pretty flawed, as I’m sure you’ll agree. But they do the job!