Configure the Python development environment under Fedora14

Source: Internet
Author: User
Install python first. Because the Fedora14 system already has python, install python under the home Directory; modify the home directory. bash_profile file, add python/bin PATH to PATH; add MySQLdb, encounter many problems linux installation mysqldb: 1. create/usr/local/python2. copy setuptools-0.6c11-py2.6.egg to/usr/local

Install python first. Since the Fedora 14 system already has python, install python in the home Directory;

Modify the. bash_profile file in the home directory and add the python/bin PATH to the PATH;

Many problems encountered when adding MySQLdb

Install mysqldb in linux:
1. Create/usr/local/python
2. Copy setuptools-0.6c11-py2.6.egg to/usr/local/python
3. Execute sh setuptools-0.6c11-py2.6.egg
4.copy mysql-python-1.2.3.tar.gz to the current directory
5. Extract
6. Modify mysql_config in site. cfg to the mysql_config path under the mysql installation directory, for example,/usr/local/mysql/bin/mysql_config.
7. Execute python setup. py build
8. Execute python setup. py install
9. After the operation is successful, run import MySQLdb to check whether the operation is successful. Generally, the following error occurs:

Mysqldb installation error:
1.zip import. ZipImportError: can't decompress data; zlib not available
Solution: recompile the Python source code installation package as follows:
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
Locate about 454 rows here
# Zlib zlibmodule. c-I $ (prefix)/include-L $ (exec_prefix)/lib-lz
Remove comments
Zlib zlibmodule. c-I $ (prefix)/include-L $ (exec_prefix)/lib-lz
Then re-compile and install python


2. ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
# Solution
# 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
Add the following to ld. so. conf:
/Usr/local/mysql/lib/mysql/
# Ldconfig-v
Test again. Successful!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.