apt-get install zlib1g-dev libjpeg-dev libpng12-dev libfreetype6-dev
freetype2-demos mysql-client libmysqlclient-dev python-dev
python-mysqldb python-pip

1、安装所有需要的开发库

编译microwindows-0.92时,遇到一些依赖问题,记录下来,以便来着参详

ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/

sudo apt-get install libjpeg-dev libjpeg62 libjpeg62-dev zlib1g-dev
libfreetype6 libfreetype6-dev

#
./xconfigure
-bash: ./xconfigure: /usr/bin/wish: bad interpreter: No such file or
directory

ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/

2、由于本人的项目跑在virtualenv中,所以用命令安装PIL和pillow两个库

# wish
The program ‘wish’ can be found in the following packages:
 * tk
 *澳门新葡萄京所有网站 , tk8.4
 * tk8.5
 * tk8.3
Try: apt-get install <selected package>
# apt-get 
install   tk8.5
Reading package lists… Done
Building dependency tree      
Reading state information… Done
The following extra packages will be installed:
  tcl8.5
Suggested packages:
  tclreadline
The following NEW packages will be installed:
  tcl8.5 tk8.5
0 upgraded, 2 newly installed, 0 to remove and 211 not upgraded.
Need to get 2,013 kB of archives.
After this operation, 7,737 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 natty/main tcl8.5 i386
8.5.9-2 [1,051 kB]
Get:2 natty/main tk8.5 i386
8.5.9-2 [962
kB]                                                                               
Fetched 2,013 kB in 2min 16s (14.7
kB/s)                                                                                                                        
Selecting previously deselected package tcl8.5.
(Reading database … 138814 files and directories currently
installed.)
Unpacking tcl8.5 (from …/tcl8.5_8.5.9-2_i386.deb) …
Selecting previously deselected package tk8.5.
Unpacking tk8.5 (from …/tk8.5_8.5.9-2_i386.deb) …
Processing triggers for man-db …
Setting up tcl8.5 (8.5.9-2) …
Setting up tk8.5 (8.5.9-2) …
update-alternatives: using /usr/bin/wish8.5 to provide /usr/bin/wish
(wish) in auto mode.
Processing triggers for libc-bin …
ldconfig deferred processing now taking place

ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/

pip install PIL
pip install pillow

 

pip install pil

如果还是不行,执行下面的命令(64位系统看下面的参考链接)

 

如果出现下面的提示,则表示安装成功

sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/
sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6/usr/lib/
sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/

1. error: jpeglib.h jerror.h No such file or directory 没有那个文件或目录

jpeg.cc:19:21: error: jpeglib.h: 没有那个文件或目录
jpeg.cc:20:20: error: jerror.h: 没有那个文件或目录

解决安装libjpeg:
新立得软件包管理器->libjpeg62-dev

 

Catch(07-26-11-17-46).jpg (上传于2013-07-26
11:30:03)
澳门新葡萄京所有网站 1

再执行命令

2. error: png.h No such file or directory 没有那个文件或目录

error: png.h: 没有那个文件或目录

解决安装libpng:
新立得软件包管理器->libpng12-dev

3.error:ft2build.h: No such file or directory

sudo apt-get install libxft2-dev

  1. make[1]: *** No rule to make target `/usr/lib/libjpeg.so’,
    needed by `/home/allen/share/ui/microwindows-0.92/src/bin/nano-X’. 
    Stop.
    make: *** [subdir-/home/allen/share/ui/microwindows-0.92/src/nanox]
    Error 2

这是一个笨办法,  实际上应该使用修改链接库搜索路径的办法

临时解决办法

# ln -s /usr/lib/i386-linux-gnu/libpng.so 
libpng.so
# ln -s /usr/lib/i386-linux-gnu/lib.so 
libpng.so
Display all 206 possibilities? (y or n)
# ln -s /usr/lib/i386-linux-gnu/libz.a  libz.a
# ls /usr/lib/i386-linux-gnu/libz.a
/usr/lib/i386-linux-gnu/libz.a
# cd ../local/lib/
# ln -s
/usr/lib/i386-linux-gnu/libfreetype.a  libfreetype.a

make 通过

关键是中间3行,JPEGZLIBFREETYPE2这三个support available就可以了

pip install -I PIL

参考Python Image Library fails with message “decoder JPEG not available
PIL”