how to install PIL package with JPEG support in windows

守給你的承諾、 提交于 2019-12-03 20:27:20
wtayyeb

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!