pipx

pipx fails for poetry on Ubuntu 20.04?


$ pipx install poetry
Could not find package poetry. Is the name correct?

$ python --version
Python 3.8.10

is there a way to work around this? this works on 22.04 perfectly.. but I want to use python 3.8.x with pipx so backed off to 20.04...


Solution

  • Short Answer:

    1. Uninstal pipx with apt:
    sudo apt purge pipx 
    
    1. Install pipx using pip:
    pip install pipx
    

    Long Answer:

    When you installed pipx, did you install it with apt or pip3?

    I ran into the same issue/error message when I installed pipx with apt on Ubuntu 20.04. 22.04 worked with no issues, but 20.04 would give the error you mentioned above "Could not find package poetry. Is the name correct?".

    To resolve the issue in 20.04, I uninstalled pipx with apt, then installed it running "pip3 install pipx" as the user which would be installing poetry.

    Instead of using the outdate version of pipx supplied by the apt repo (which was 0.12.3.1 for me), it used the newer 1.1.0 version. From there, I was able to successfully install poetry using "pipx install poetry".

    Just make sure that you add /home/username/.local/bin to your user's PATH environment variable, where username is the user you're running pipx from.