1

A package (poetry, for use with python), was installed on an installation of Ubuntu 24.10/oracular.

The package was installed using pipx:

pipx install poetry 

It is required to update poetry using pipx (poetry updating itself using the poetry self update command is not an option in this case). To do this the following is run:

pipx upgrade poetry 

This returns an error saying that the package is not installed:

Package is not installed. Expected to find /home/sir_mallard/.local/share/pipx/venvs/poetry, but it does not exist. 

However, the package is installed, as can be found by running:

which poetry 

which returns

/home/sir_mallard/.local/bin/poetry 

How can pipx's expected installation location for the package be changed to the installed location, so that pipx can be used to upgrade the package?

2 Answers 2

1

Sounds like poetry is not currently installed through pipx. The following commands should help clear this out.

Confirm that poetry works at all:

/home/sir_mallard/.local/bin/poetry --version 

See where pipx installs its packages and confirm that it lists poetry:

pipx list 

See the interpreter for poetry and confirm that the executable exists at that location:

ls -lh "$(head -n1 /home/sir_mallard/.local/bin/poetry | sed 's/#!//')" 
1
  • Thank you, one of the returns from pipx list is "-poetry (symlink missing or pointing to unexpected location). I'm not sure what the issue is but this does show this gives a clear point to investigate. Commented Jun 26 at 18:59
1

You have to use virtual environments. Due to the problems caused by mixing pip management and distribution package management, Python has moved towards venvs, and recently has started disallowing installing packages on a distro managed python installation.

To create venv, run python -m venv test to create a venv named test. This will create a directory named test with your virtual environment inside it.

To start bash in the new venv, run source test/bin/activate. This will give you a shell running in the venv, and all python3 commands will only modify the virtual environment, so you can add packages without risk of conflict.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.