Skip to content

_imaging.py doesn't have PILLOW_VERSION attribute after building with all dependencies with VS2019 #4857

@newfeatureengineer

Description

@newfeatureengineer

What did you do?

Built pillow from source using the script in winbuild.

What did you expect to happen?

I expected the package to work.

What actually happened?

Package seems broken.

What are your OS, Python and Pillow versions?

  • OS: Windows 10
  • Python: 3.7.7
  • Pillow: 7.2.0
  1. Extract pillow-7.2.0.tar.gz
  2. cd to winbuild
  3. python build_prepare.py
  4. cd to build
  5. build_dep_all (had to modify winbuild\build\lcms2-2.11\Projects\VC2017\lcms2_static\lcms2_static.vcxproj to point to the installed windows SDK version (10.0.19041.0) for it to compile, but otherwise, everything worked fine).
  6. build_pillow
  7. back in the root of the extracted package, run python setup.py install
  1. python selftest.py
    Fails with
RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: None
Pillow version: 7.2.0
Traceback (most recent call last):
  File "selftest.py", line 6, in <module>
    from PIL import Image, features
  File "c:\venv\lib\site-packages\pillow-7.2.0-py3.7-win-amd64.egg\PIL\Image.py", line 100, in <module>
ImportError: The _imaging extension was built for another version of Pillow or PIL:
Core version: None
Pillow version: 7.2.0

Because PIL\_imaging.py loads from _imaging.cp37-win_amd64.pyd with no attribute named PILLOW_VERSION.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions