python图形处理库Python Imaging Library (PIL)

pil站点: http://www.pythonware.com/products/pil/index.htm
pil下载: http://effbot.org/downloads/Imaging-1.1.6.tar.gz
pil文档: http://www.pythonware.com/library/pil/handbook/index.htm
  
[安装]
$ tar zxvf Imaging-1.1.6.tar.gz
$ cd Imaging-1.1.6
$ python setup.py build_ext -i
$ python selftest.py
$ python setup.py install
安装完毕后,可在python安装目录下的site-packages找到PIL安装目录。

Tags: pil, python


Dreamhost 上编译python并安装django

1. 升级python到2.5.2:
用Putty登录到DreamHost的Shell控制台执行如下的命令:
mkdir optcd optmkdir packagescd packageswget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgztar -xzvf Python-2.5.2.tgzcd Python-2.5.2./configure -prefix=$HOME/optmakemake install
python 2.5已经安装好了。把python 2.5设置为默认版本:
vim .~/bash_profile
然后,在.bash_profile里加入一条:
export PATH=$HOME/opt/bin/:$PATH
重新载入配置文件:
source ~/.bash_profile
检验一下是否成功:
$python -VPython 2.5.2
2. 安装python-Mysql
cd ~/opt/packageswget http://internap.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.2.tar.gztar xvzf MySQL-python-1.2.2.tar.gzcd MySQL-python-1.2.2python setup.py install
3. 安装django
cd ~/opt/packageswget http://www.djangoproject.com/download/1.0/tarball/tar -xzvf Django-1.0.tar.gzcd Django-1.0python setup.py install
在python交互环境下查看django的版本,以测试安装配置的准确性。
$python>>>import django>>>django.VERSION(1, 0, 'final')
4. 创建Django项目
mkdir ~/django_projectscd ~/django_projectsdjango-admin.py startproject myprojectchmod 600 myproject/settings.py
vim myproject/settings.py :
DATABASE_ENGINE = 'mysql'           # 'postgresql_psycopg2', [...]