Install the python library module in linux

Source: Internet
Author: User
Tags download redis

Install the python library module in linux

Today, we need to deploy a python script on an online server, which uses MySQLdb and various attempts to download source code (various dependent libraries are incompatible with each other ), get/yum (this linux is so pure that neither of them can be used) installation, wget downloading the rpm package cannot connect to the Internet, and both failed, in addition, libmysqlclient-dev and MySQL-python are not easy to find. They also have many versions, which are incompatible with each other ..

The available version is

Ftp://rpmfind.net/linux/centos/6.6/ OS /x86_64/Packages/MySQL-python-1.2.3-0.3.c1.1.el6.x86_64.rpm

And

Http://archive.debian.net/zh-cn/etch/amd64/libmysqlclient15-dev/download

The two software packages wget to one server, use alien to convert the deb format to the rpm format, and then send the two rpm packages rsync-avzP to the online server, and then follow the sequence rpm-ivh, OK

Then findRedis-pythonNo. This time, the same method will not work. Installing redis-py depends on redis and relying on rpm-helper to rely on system-units ...... endless.

In addition, none of the RPMs obtained from rpmfind succeeded, either the dependent library or the version> =.

There are two ways to install the software. If there is no other way to install the software, you must compile the source code:

Download redis-py-2.7.1.tar.gz:

Http://download.chinaunix.net/down.php? Id = 44261 & ResourceID = 13387 & site = 1

Tar-xvf, and then cd into make, right, make install is still correct? Try to import redis in python. Is that correct ?! Well, it seems we have done it.

Use alien tool to convert deb format to rpm format

Alien_8.87.tar.gz

Download alien_8.87.tar.gz

[Root @ mysqlnode2 ~] # Wget http://ftp.de.debian.org/debian/pool/main/a/alien/alien_8.87.tar.gz

[Root @ mysqlnode2 ~] # Tar zxvf alien_8.87.tar.gz

[Root @ mysqlnode2 ~] # Cd alien

[Root @ mysqlnode2 alien] # perl Makefile. PL

[Root @ mysqlnode2 alien] # make

[Root @ mysqlnode2 alien] # make install

Convert libnet0-dev_1.0.2a-7_i386.deb to libnet0-dev-1.0.2a-8.i386.rpm

[Root @ mysqlnode2 ~] # Alien-r libnet0-dev_1.0.2a-7_i386.deb

Warning: Skipping conversion of scripts in package libnet0-dev: postinst prerm

Warning: Use the -- scripts parameter to include the scripts.

Libnet0-dev-1.0.2a-8.i386.rpm (generated)

Install the rpm package

[Root @ mysqlnode2 ~] # Rpm-ivh libnet0-dev-1.0.2a-8.i386.rpm

Related Article

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.