question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

/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:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

34reactions
sdispatercommented, Oct 18, 2018

Do you execute source $HOME/.poetry/env before calling poetry?

14reactions
robertlagrantcommented, Mar 29, 2019

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 do ENV 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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found