Skip to content

Errors with v49.2.0's distutils adoption #2261

@hugovk

Description

@hugovk

Related to #2256 / #2259.

When upgrading to setuptools>=49.1.3 for the #2249 fix for Pillow, we get the new warning in v49.2.0:

/home/travis/virtualenv/python3.9-dev/lib/python3.9/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.

This also causes some C build issues and this sanity test failure; Pillow checks the version in the lower-level C code ("Core version") matches that in the user-facing Python code ("Pillow version"):

/home/travis/virtualenv/python3.9-dev/lib/python3.9/site-packages/Pillow-7.3.0.dev0-py3.9-linux-x86_64.egg/PIL/Image.py:115: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: None
Pillow version: 7.3.0.dev0


Moving the setuptools import before distutils in our setup.py removes the warning but not the error.

https://travis-ci.org/github/hugovk/Pillow/builds/707730154

I've not dug into this further, but it's happening at least on all the Linux/Python versions tested on Travis (3.5-3.9), and wanted to let you know.

More details at python-pillow/Pillow#4784 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions