paster (PasteScript): No module named 'pkg_resources' (tested)

PasteScript 3.7.0, the latest release, does import pkg_resources in paste/script/command.py, so on setuptools 82 or newer every paster command fails with ModuleNotFoundError: No module named 'pkg_resources'. Tested fix: pip install "setuptools<81".

1. The error: PasteScript 3.7.0 with setuptools 84

pip install PasteScript==3.7.0 (the newest release, 2025-01-22) into a Python 3.11.17 venv with setuptools 84.2.1:

$ paster --help
Traceback (most recent call last):
  File "/path/to/venv/bin/paster", line 4, in <module>
    from paste.script.command import run
  File "/path/to/venv/lib/python3.11/site-packages/paste/script/command.py", line 3, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

paste/script/command.py line 3 is a plain import pkg_resources, and every paster command goes through that module. setuptools 82.0.0 removed pkg_resources. PasteScript lists setuptools as a dependency with no upper bound, so pip does not stop you from installing a version that breaks it.

2. Fix: pin setuptools below 81 (tested)

$ pip install "setuptools<81"    # gave 80.10.2
$ paster --help
/path/to/venv/lib/python3.11/site-packages/paste/script/command.py:3: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
Usage: paster [paster_options] COMMAND [command_options]

...

paster works again, with the pkg_resources is deprecated as an API warning. Hide it with PYTHONWARNINGS="ignore:pkg_resources is deprecated as an API".

3.7.0 is the latest PasteScript on PyPI, so there is no fixed release to upgrade to.

Related: No module named 'pkg_resources' (general fix) · Trac 1.6 · supervisord.

Frequently asked questions

Is there a newer PasteScript that fixes it?

Not on PyPI as of 2026-10-24: 3.7.0 (2025-01-22) is the latest and still imports pkg_resources at the top of command.py.

Does the pin change how paster behaves?

No. setuptools 80.10.2 still includes pkg_resources, so paster runs as before; it only prints a deprecation warning.

Written with AI assistance. Measured on 2026-10-24 on Linux with PasteScript 3.7.0, CPython 3.11.17, setuptools 80.10.2 and 84.2.1. Output pasted unedited except shortened paths. PlainTables is our extension; PasteScript is free.