fedora14下配置python开发环境

先装python,由于fedora 14系统已有python,将python安装至home目录下;

修改home目录下.bash_profile文件,添加python/bin路径到path中;

添加mysqldb,遇到很多问题

linux 安装mysqldb: 1. 创建/usr/local/python 2.复制setuptools-0.6c11-py2.6.egg到/usr/local/python 3.执行sh setuptools-0.6c11-py2.6.egg 4.复制mysql-python-1.2.3.tar.gz到当前目录 5.解压 6.修改site.cfg中的mysql_config,改成mysql安装目录下的mysql_config路径,如:/usr/local/mysql/mysql/bin/mysql_config 7.执行python setup.py build 8.执行python setup.py install 9.成功后,执行import mysqldb,看成功否,一般来说,这时候不成功的错误如下:

mysqldb安装出错: 1.zipimport.zipimporterror: can’t decompress data; zlib not available 解决办法重新编译一下python源码安装包,如下: 1 tar jxvf python-2.5.2.tar.bz2 2 cd python-2.5.2/ 3 ls 4 sudo ./configure 5 gvim modules/setup 6 sudo gvim modules/setup 在这里把454行左右的 找到 #zlib zlibmodule.c -i$(prefix)/include -l$(exec_prefix)/lib -lz 去掉注释 zlib zlibmodule.c -i$(prefix)/include -l$(exec_prefix)/lib -lz 然后重新编译,安装python

2.importerror: libmysqlclient_r.so.16: cannot open shared object file: no such file or directory #解决方法 #updatedb #locate libmysqlclient_r.so.16 /usr/local/mysql-5.1.30-linux-i686-glibc23/lib/libmysqlclient_r.so.16.0.0 /usr/local/mysql-5.1.30-linux-i686-glibc23/lib/libmysqlclient_r.so.16 /usr/local/mysql/lib/mysql/libmysqlclient_r.so.16 /usr/local/mysql/lib/mysql/libmysqlclient_r.so.16.0.0 #vi /etc/ld.so.conf 在ld.so.conf中加入: /usr/local/mysql/lib/mysql/ #ldconfig -v 再次测试,成功!