poetry: --sync removes pkg-resources, leading to pillow error

  • Poetry version: 1.2.1
  • Python version: 3.8.10
  • OS version and name: Ubuntu 20.04.3 LTS
  • pyproject.toml:
[tool.poetry]
name = "test1"
version = "0.1.0"
description = ""
authors = ["Claudia"]

[tool.poetry.dependencies]
python = "~3.8"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Issue

When running poetry install --sync, poetry removes anything pre-installed (as it should), unfortunately this includes pkg-resources (see #2673 for a discussion), which is pre-installed. Removing this package leads to an error when trying to then poetry add pillow, as discussed in #5104.

I also tried this with Poetry 1.2.0b2, mentioned in #5104 - same problem.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (13 by maintainers)

Most upvoted comments

but you wouldn’t declare an explicit dependency on pkg_resources, you’d declare a dependency on setuptools.

So then poetry would see no reason to keep the unbundled pkg_resources around