poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Error message from poetry self add referencing pyproject.toml

Open johtoblan opened this issue 10 months ago • 3 comments

Description

After uninstalling and installing poetry I want to add poetry-plugin-shell to my "main" poetry, but I get an error message claiming poetry-plugin-shell is already present in the pyproject.toml. Which pyproject.toml is 'poetry self' using?

user:~$ poetry self add poetry-plugin-shell
The following packages are already present in the pyproject.toml and will be skipped:

  - poetry-plugin-shell

If you want to update it to the latest compatible version, you can use `poetry self update`.
If you prefer to upgrade it to the latest available version, you can use `poetry self add package@latest`.

Nothing to add.
user:~$ curl -sSL https://install.python-poetry.org | python3 - --uninstall
Removing Poetry (2.0.1)
user:~$ curl -sSL https://install.python-poetry.org | python3 -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/home/user/TESTPOETRY/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (2.0.1): Done

Poetry (2.0.1) is installed now. Great!

You can test that everything is set up by executing:

`poetry --version`

user:~$ poetry self add poetry-plugin-shell
The following packages are already present in the pyproject.toml and will be skipped:

  - poetry-plugin-shell

If you want to update it to the latest compatible version, you can use `poetry self update`.
If you prefer to upgrade it to the latest available version, you can use `poetry self add package@latest`.

Nothing to add.
user:~$ poetry shell

The command "shell" does not exist.

Workarounds

Using poetry update fixes this. clearing the cache does not seem to affect the knowledge of old plugins

Poetry Installation Method

install.python-poetry.org

Operating System

Ubuntu 24.04

Poetry Version

Poetry (version 2.0.1)

Poetry Configuration

cache-dir = "/home/johannestl/.cache/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/johannestl/.cache/pypoetry/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false

Python Sysconfig

sysconfig.log
Paste the output of 'python -m sysconfig', over this line.

Example pyproject.toml


Poetry Runtime Logs

poetry-runtime.log
poetry -vvv self add poetry-plugin-shell

Loading configuration file /home/user/.config/pypoetry/config.toml
Loading configuration file /home/user/.config/pypoetry/auth.toml
The following packages are already present in the pyproject.toml and will be skipped:

  - poetry-plugin-shell

If you want to update it to the latest compatible version, you can use `poetry self update`.
If you prefer to upgrade it to the latest available version, you can use `poetry self add package@latest`.

Nothing to add.

Paste the output of 'poetry -vvv <command>', over this line.
Both configuration files /home/user/.config/pypoetry/config.toml and /home/user/.config/pypoetry/auth.toml are empty

johtoblan avatar Feb 14 '25 08:02 johtoblan

I'm seeing something very similar trying to install poetry-multiproject-plugin


`The following packages are already present in the pyproject.toml and will be skipped:

  - poetry-multiproject-plugin

If you want to update it to the latest compatible version, you can use `poetry self update`.
If you prefer to upgrade it to the latest available version, you can use `poetry self add package@latest`.

Nothing to add.`

I've tried removing poetry, clearing the locally installed python packages, removing and re cloning the repo, clearing the caches in poetry

initial I was following a tutorial on building multiple packages using poetry, I cloned a repo, installed poetry , installed the poetry-multiproject-plugin, and the poetry-polylith-plugin which appeared to be working

I tried to install the poetry-plugin-lambda-build, and hit up various errors, now nothing I do seems to get me back to a working state

also using v2.0.1 of poetry

garysmi avatar Feb 15 '25 00:02 garysmi

Same issue with poetry 1.8.4 and plugin poetry-plugin-bundle. I uninstalled and reinstalled poetry with mise, didn't help. Ubuntu 24.04.

Edit: Same issue with poetry 2.1.1. But adding the plugin version fixed it! poetry self add poetry-plugin-bundle@latest in my case.

graham2071 avatar Feb 18 '25 09:02 graham2071

I also failed with:

poetry self add poetry-plugin-shell
The following packages are already present in the pyproject.toml and will be skipped:

  - poetry-plugin-shell

If you want to update it to the latest compatible version, you can use `poetry self update`.
If you prefer to upgrade it to the latest available version, you can use `poetry self add package@latest`.

Nothing to add.

and then succeeded with:

$ poetry self add poetry-plugin-shell@latest
Using version ^1.0.1 for poetry-plugin-shell

Updating dependencies
Resolving dependencies... (0.3s)

Package operations: 3 installs, 19 updates, 0 removals

  - Downgrading certifi (2025.7.14 -> 2025.1.31)
  - Downgrading h11 (0.16.0 -> 0.14.0)
  - Downgrading typing-extensions (4.14.1 -> 4.13.2)
  - Downgrading charset-normalizer (3.4.2 -> 3.4.1)
  - Downgrading cryptography (45.0.5 -> 44.0.2)
  - Downgrading httpcore (1.0.9 -> 1.0.8)
  - Downgrading more-itertools (10.7.0 -> 10.6.0)
  - Downgrading urllib3 (2.5.0 -> 2.4.0)
  - Downgrading distlib (0.4.0 -> 0.3.9)
  - Downgrading jaraco-functools (4.2.1 -> 4.1.0)
  - Downgrading msgpack (1.1.1 -> 1.1.0)
  - Downgrading packaging (25.0 -> 24.2)
  - Downgrading platformdirs (4.3.8 -> 4.3.7)
  - Downgrading requests (2.32.4 -> 2.32.3)
  - Downgrading cachecontrol (0.14.3 -> 0.14.2)
  - Downgrading pbs-installer (2025.7.23 -> 2025.4.9)
  - Installing ptyprocess (0.7.0)
  - Downgrading tomlkit (0.13.3 -> 0.13.2)
  - Downgrading trove-classifiers (2025.5.9.12 -> 2025.4.11.15)
  - Downgrading virtualenv (20.32.0 -> 20.30.0)
  - Installing pexpect (4.9.0)
  - Installing poetry-plugin-shell (1.0.1)

Writing lock file

adamatblackswanspace avatar Jul 28 '25 11:07 adamatblackswanspace