python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
30.09k stars 2.23k forks source link

No module named 'packaging.metadata' #9406

Closed FelixBenning closed 1 month ago

FelixBenning commented 1 month ago

Description

$ pipx uninstall poetry
Nothing to uninstall for poetry 😴
$ pipx install poetry
  installed package poetry 1.8.3, installed using Python 3.10.5
  These apps are now globally available
    - poetry
done! ✨ 🌟 ✨
$ poetry

No module named 'packaging.metadata'

Workarounds


$ pipx install poetry==1.7
  installed package poetry 1.7.0, installed using Python 3.10.5
  These apps are now globally available
    - poetry
done! ✨ 🌟 ✨
$ poetry
Poetry (version 1.7.0)

...

Poetry Installation Method

pipx

Operating System

Red Hat Enterprise Linux 8.6 (Ootpa)

Poetry Version

1.8.3

Poetry Configuration

Not really possible to do if the poetry command fails

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

-
FelixBenning commented 1 month ago

This is a duplicate of #9034 but that issue has been auto closed

dimbleby commented 1 month ago

poetry 1.8.3 declares a dependency on packaging>=23.1, which provides packaging.metadata.

I don't know what is wrong with your install - you will have to investigate that yourself - but it seems likely that there is nothing more that can or should be done from this repository

hxmn commented 1 month ago

@FelixBenning I came across this after a recent update to oh-my-zsh. The problem was that the virtualenv-autodetect plugin set the PYTHONPATH variable incorrectly. Disabling this plugin allowed me to continue working with poetry.