Installing Redis, and how Python references Redis

Source: Internet
Author: User
Tags redis server

Download

cd/usr/local/src/

wget http://download.redis.io/releases/redis-2.8.17.tar.gz

Extract

TAR-ZXVF redis-2.8.17.tar.gz

Install the compilation component

Yum Install build-essential

Switch to the redis-2.8.17 directory, compile

Make

(Output hint:it ' s a good idea-to-run ' make test ';) ) indicates success

Go to Catalog

/home/redis/redis-2.8.17/src

The following new files will be generated under this directory

Redis-benchmark (Redis Performance test tool)

Redis-check-aof

Redis-check-dump

REDIS-CLI (Redis command Line Operations tool)

Redis-sentinel

Redis-server (daemon boot program for Redis server)

Start./redis-server

Test:./redis-cli

The default port to start is 6397

After installing Redis, when importing Redis through a Python program, encountered a "Importerror:no module named Redis" Error, the online check the following reasons, the solution is as follows:

Python does not support Redis by default, and when you reference Redis, you get an error:

You need to install the Redis library for python, download https://github.com/andymccurdy/redis-py, unzip and install

You can also install the Git tool

Apt-get install-y git

git clone https://github.com/andymccurdy/redis-py

Switch to the Redis-py directory and locate the setup.py

Execute python setup.py Install

Enter the Python editor to import Redis as normal

Installing Redis, and how Python references Redis

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.