Skip to content

fix: setup.py breaks on Python 3.12+ due to deprecated pkg_resources #963

@Jayantparashar10

Description

@Jayantparashar10

Description

On Python 3.12+ (conda/miniconda environments with latest pip/setuptools), running

pip install -e ".[dev]"

or

pip install -e .

fails with:

ModuleNotFoundError: No module named 'pkg_resources'

This happens because setup.py uses the deprecated pkg_resources and modern pip uses strict build isolation (no setuptools in the temp build env by default).

Reproduction Steps

  1. Fresh Python 3.12 conda env
  2. git clone https://github.com/fossasia/visdom.git
  3. cd visdom
  4. pip install -e ".[dev]"

Expected Behavior

Should install cleanly in editable mode (as it does on Python 3.10/3.11 with older setuptools).

Proposed Fix

  • Replace pkg_resources with importlib.metadata (available in stdlib since Python 3.8)
  • Also fix the boolean logic in the pillow-simd fallback (get_dist() was returning True/False but being compared with is not None, causing pillow-simd to always be selected, breaking builds on macOS/ARM

This fix will make Visdom installable again for all Python >= 3.8

Environment

  • OS: macOS (also happens on Linux)
  • Python: 3.12
  • pip/setuptools: latest

I am preparing a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions