how to install PIL package with JPEG support in wi

2019-04-01 18:24发布

I want to install PIL package on windows, its easy. but decoder jpeg not available. which packages are needed to download and installed befor PIL so it gets work?

2条回答
劳资没心,怎么记你
2楼-- · 2019-04-01 18:33

Solution that worked for me (assuming you have the tools to compile packages, which depend on your python version, installed):

  • Download precompiled binaries from http://gnuwin32.sourceforge.net/packages/jpeg.htm (you need the developer files and binaries).

  • Download PIL sources, open setup.py, and change JPEG_ROOT (line 37):

    JPEG_ROOT = libinclude(JPEG_LIB_ROOT)

  • Run setup.py install.

  • Copy jpeg62.dll from the jpeglib binaries to your site-packages\PIL directory.

That's it, it should now work.

查看更多
唯我独甜
3楼-- · 2019-04-01 18:41

I found the solution.

one has to use easy_install PIL instead of pip install PIP in Windows.
easy_install finds local installation or installs the libjpeg from the source and connects it to PIL while pip cannot do that.

查看更多
登录 后发表回答