How do I install PIL/Pillow for Python 3.6?

后端 未结 3 1804
予麋鹿
予麋鹿 2020-12-05 04:10

I have a script that requires PIL to run. Other than downgrading my Python, I couldn\'t find anyway to install PIL on my Python 3.6

Here are my attempts:

<         


        
3条回答
  •  天命终不由人
    2020-12-05 04:31

    Pillow is released with installation wheels on Windows:

    We provide Pillow binaries for Windows compiled for the matrix of supported Pythons in both 32 and 64-bit versions in wheel, egg, and executable installers. These binaries have all of the optional libraries included

    https://pillow.readthedocs.io/en/3.3.x/installation.html#basic-installation

    Update: Python 3.6 is now supported by Pillow. Install with pip install pillow and check https://pillow.readthedocs.io/en/latest/installation.html for more information.


    However, Python 3.6 is still in alpha and not officially supported yet, although the tests do all pass for the nightly Python builds (currently 3.6a4).

    https://travis-ci.org/python-pillow/Pillow/jobs/155605577

    If it's somehow possible to install the 3.5 wheel for 3.6, that's your best bet. Otherwise, zlib notwithstanding, you'll need to build from source, requiring an MS Visual C++ compiler, and which isn't straightforward. For tips see:

    https://pillow.readthedocs.io/en/3.3.x/installation.html#building-from-source

    And also see how it's built for Windows on AppVeyor CI (but not yet 3.5 or 3.6):

    https://github.com/python-pillow/Pillow/tree/master/winbuild

    Failing that, downgrade to Python 3.5 or wait until 3.6 is supported by Pillow, probably closer to the 3.6's official release.

提交回复
热议问题