2

I am trying to install poetry the recommended way on Ubuntu 20.04.3 LTS:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -

When I do so, it says:

content.com/python-poetry/poetry/master/get-poetry.py | python -

Command 'python' not found, did you mean:

command 'python3' from deb python3 command 'python' from deb python-is-python3

curl: (23) Failed writing body (485 != 1378)

Then I try python3

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -

The installation succeeds.

Afterwards when calling poetry --version to test the installation, I get:

poetry: command not found

Although I added poetry to PATH manually, in .bash_profile:

PATH=$PATH:~/poetry/bin

I also tried adding poetry to path in .bashrc similarly to this answer:

export PATH="~/poetry/bin:$PATH"
LuGeNat
  • 23

2 Answers2

2

For the sake of posterity, the old approach the OP mentions to installing Poetry has been deprecated. As of 22 Sep 2022, they recommend using the following command for Linux:

curl -sSL https://install.python-poetry.org | python3 -

I used this on Ubuntu 20.04.4 LTS and everything went smoothly.

1

You add ~/poetry/bin to PATH, but it should be ~/.poetry/bin.


Regarding python is not available, you can (re)install python-is-python3 package via apt:

sudo apt install python-is-python3
pLumo
  • 26,947
  • "add a symlink manually" will be out of the APT control. Suggesting to remove this recommendation from answer. – N0rbert Dec 02 '21 at 10:42