分类: Python/Ruby
2011-11-30 17:40:20
操作系统版本: Ubuntu 10.04 LTS (i686)
Python版本: 2.6.5
#install pip
cd /root/
wget
sudo python distribute_setup.py
wget
tar xzvf pip-1.0.2.tar.gz
cd pip-1.0.2
python setup.py install
#install virtualenv
pip install virtualenv
#Install TurboGears2
virtualenv --no-site-packages tg2env
cd tg2env/
source bin/activate
#install MySQLdb (MySQL-python)
apt-get install python2.6-dev
##sudo apt-get --purge remove python-mysqldb
##sudo apt-get --purge install python-mysqldb
cd /root
tar xzvf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
python setup.py install
#WebOb must < 1.2
pip uninstall WebOb
pip install "WebOb==1.0.8"
pip install tg.devtools
######################################################
#Quick start a project
paster create test01
##paster quickstart test01
#Start the app
cd test01
python setup.py develop
paster serve --reload development.ini
#####################################################################
排错:
1 现象 :pkg_resources.VersionConflict: (WebOb 1.0.8 (/root/tg2/lib/python2.6/site-packages), Requirement.parse('WebOb>=1.1.1'))
排查:(tg2)[root@dev2 tg2]# grep -r WebOb * |grep 1.
lib/python2.6/site-packages/TurboGears2-2.1.4-py2.6.egg-info/requires.txt:WebOb == 1.0.8
lib/python2.6/site-packages/Pylons-1.0.1rc1-py2.6.egg-info/requires.txt:WebOb>=1.1.1
解决:pip uninstall Pylons; pip install "Pylons==1.0.0"