I have a WSL instance, Ubuntu 20.04 and I have created another Ubuntu 18.04 WSL instance.
I installed Poetry on the 20.04 without issues.
I am trying to install Poetry on the Ubuntu 18.04 instance, using the curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
command.
At the moment, my $HOME env var points to /home/fromzeroedu
.
However, after installation, Poetry is installed on my Windows user home:
$ which poetry
/mnt/c/Users/j/.poetry/bin/poetry
And if I try getting the version, I get:
$ poetry --version
/usr/bin/env: ‘python\r’: Permission denied
I even tried setting the POETRY_HOME
prior to installation:
export POETRY_HOME=/home/fromzeroedu/.poetry/bin/poetry
But Poetry still installs in the Windows user directory.
Sometimes I love Poetry...
That was because bash didn't knew where to look for the bin so it found only the Windows executable (PATH
is shared between wsl and windows)
to solve it you needed to add the following to your ~/.bashrc
(preferably on top)
export PATH="$HOME/.poetry/bin:$PATH"
With the new installer (poetry 1.1.7 onward) the Bin path changed
export PATH="$HOME/.local/bin:$PATH"
I faced this issue cause I'm using autocomplete plugin for oh-my-zsh and poetry needs to be added to PATH
before the plugin is loaded. but the installation script append it at the end.