poetry: Poetry 1.5 fails to install dependencies

  • Poetry version: 1.5
  • Python version: 3.10
  • OS version and name: Ubuntu 20.04
  • [X ] I am on the latest stable Poetry version, installed using a recommended method.
  • [ X] I have searched the issues of this repo and believe that this is not a duplicate.
  • [X ] I have consulted the FAQ and blog for any relevant entries or release notes.
  • [ X] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

When running Poetry install with the latest version (1.5) that was just released, I am getting No such file or directory 'python'.

The exact same project etc works fine with version 1.4.2.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 10
  • Comments: 16 (7 by maintainers)

Most upvoted comments

thanks for the quick fix @radoering ,given how a minor release instantly broke tons of production builds, it might be good to add an update to the blog post, warning users using local environments (which id wager is the majority) to not update to 1.5.0 and wait for 1.5.1.

@dimbleby I have done more investigating. I believe this error only happens when following environment variable is set:

POETRY_VIRTUALENVS_IN_PROJECT=true

Here is a pyproject.toml file I have used:

[tool.poetry]
name = "test"
# this version is not used directly
# to get the latest version run git describe --tags --abbrev=0
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "~3.10"
click = "^8.0.4"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

With the following Dockerfile

FROM ubuntu

RUN apt update

RUN apt install -y python3 curl vim

ADD pyproject.toml /

ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV PATH="/root/.local/bin:${PATH}"

# installing using version 1.4.2 - this will work
RUN curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
RUN poetry install --verbose

RUN rm -rf .venv

# Remove 1.4.2 version
RUN curl -sSL https://install.python-poetry.org | python3 - --uninstall

# installing using version 1.5
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN poetry install --verbose

Please run the following command (I am running it on mac):

docker build -t python -f Dockerfile --no-cache .

What you should see that the instructions in the file which operate on Poetry version 1.4.2 passes correctly. However, when you reach the last command in the Dockerfile which uses 1.5 that should fail with the error I provided before.

Hope this helps to understand the root cause.