Python PIL : IOError: decoder jpeg not available

The first thing I check when I got this error was to check if libjpeg was installed. 
Lets try this

  1. sudo apt-get install libjpeg libjpeg-dev  
  2. sudo apt-get install libfreetype6 libfreetype6-dev   

download jpeg source

  1. tar -xzvf jpegsrc.v8c.tar.gz  
  2. cd jpeg-6b/  
  3. ./configure  
  4. make  
  5. sudo make install  


So download Python Imaging Library 1.1.7 Source Kit (all platforms) 

The after run the setup.py install, check if the support was ok

  1. --------------------------------------------------------------------  
  2. *** TKINTER support not available (Tcl/Tk 8.5 libraries needed)  
  3. --- JPEG support available  
  4. --- ZLIB (PNG/ZIP) support available  
  5. *** FREETYPE2 support not available  
  6. --- LITTLECMS support available  
  7. --------------------------------------------------------------------  

If not, in setup.py in PIL I had to change the path of :

  1. JPEG_ROOT = None  
  2. ZLIB_ROOT = None  

to
  1. JPEG_ROOT = libinclude("/usr/")  
  2. ZLIB_ROOT = libinclude("/usr/")  
 
posted @   网恋被骗5元  阅读(1542)  评论(0编辑  收藏  举报
编辑推荐:
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
阅读排行:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 【.NET】调用本地 Deepseek 模型
点击右上角即可分享
微信分享提示