Hacker News new | ask | show | jobs
by smnrchrds 2381 days ago
The recommended installation method still doesn't work without manual intervention. For the reference, I use WSL with the latest Ubuntu LTS version.

- I tried using the recommended installation method of

    curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
Didn't work. I don't have python installed, just python3. Fair enough.

- Using the above method, but replacing `| python` with `| python3`: The installation works. But trying to invoke poetry gives this error:

    /usr/bin/env: ‘python’: No such file or directory
Turns out poetry executable is calling python in the shebang.

- Manually changed shebang in `$HOME/.poetry/bin/poetry` to `#!/usr/bin/env python3`: Now poetry runs successfully.

I mean, it works, but it is fragile (shebang probably needs to be manually reset at every update), not beginner-friendly, and not ergonomic. Installing using pip3 has the same issue. In comparison, pipenv is much easier to install. I was hoping this issue would not be present for poetry v1.0, but unfortunately it is.

3 comments

Curious what's stopping you from symlinking python3 to python? In fact, I'm surprised the package manager didn't already do that (I thought it did for Debian and its derivatives, including Ubuntu). Does WSL throw a wrench in that or something?
Because python link/binary is python 2, which you might also have installed

Being able to rely on python being python 2 and python3 being python 3 is pretty useful

The problem is exactly with you having `python3` but not `python`. The convention is to use them both only if you have both Python versions 2 and 3; otherwise there should always be a `python` command on your system. If you insist on having only `python3` you will keep running into problems.

My recommendation is to either create an alias for `python3`, or even better use `pyenv`: https://github.com/pyenv/pyenv

I had the same experience. It tells me that poetry is on the right track but not ready for serious use yet.