How do I install PIL/Pillow for Python 3.6?

后端 未结 3 1796
予麋鹿
予麋鹿 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:26

    You can download the wheel corresponding to your configuration here ("Pillow‑4.1.1‑cp36‑cp36m‑win_amd64.whl" in your case) and install it with:

    pip install some-package.whl

    If you have problem to install the wheel read this answer

    0 讨论(0)
  • 2020-12-05 04:28

    For python version 2.x you can simply use

    • pip install pillow

    But for python version 3.X you need to specify

    • (sudo) pip3 install pillow

    when you enter pip in bash hit tab and you will see what options you have

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题