linux 安装 python Django mysql-python

安装python

下载python

http://www.python.org/

./configure –prefix=/home/admin/python

指定安装目录

安装django

https://www.djangoproject.com/download/

 

下载后解压进入目录

python setup.py install

安装mysql-python

你需要gcc,setuptools,mysql,zlib

详情可见readme

http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/

下载后安装

tar xfz MySQL-python-x.x.x.tar.gz

cd MySQL-python-x.x.x

python setup.py build

sudo python setup.py install

安装setuptools

http://pypi.python.org/pypi/setuptools

 

下载 http://peak.telecommunity.com/dist/ez_setup.py

./ez_setup.py 即可

其他问题

1、mysql_config not found

vi setup_posix.py 或 vimsetup_posix.py打开配置文件,找到mysql_config.path一行,把路径改为mysql安装路径下bin目录,即mysql_config.path =”/usr/local/mysql/bin/mysql_config”。

或者尝试指定mysql_home环境变量

2、python 多版本问题

尝试alias python=’python2.7′

或者把/usr/bin/python 换为python2.7

3、windows下安装MySQL-python各种问题

建议直接下编译好的安装包

 

http://www.codegood.com/

  1. 暂无评论

  1. 暂无 Trackback

return top