---
title: "Install redis for pyton on windows"
author: "zhb8015"
date: "2015-05-07T12:19:36Z"
tags: ["Redis"]
categories: ["数据库"]
slug: "install-redis-for-pyton-on-windows"
draft: false
lastmod: "2015-05-07T12:19:36Z"
id: 2209095
url: "https://peter8015.iteye.com/blog/2209095"
---

Downloan redis 2.7.4. The python interface to the reids key-value store. The url:https://github.com/andymccurdy/redis-py  
installation the redis for python.

- to install redis-py: $sudo pip install redis
- alternatively: $sudo easy\_install reids
- or from source: $sudo python setup.py intall

If you are windows user, put the redis package to $(python path)/lib and install with python setup.py install.  
when you input ‘import redis’ and no syntaxerror. That’s mean reids is OK.

then start with redis:  
when you start redis with python, you should start redis server, you can setup the redis in local, start redis-server. If your python run with ‘ConnectionError: Error 10061 connecting 127.0.0.1:6379′, that’s mean your redis server has problem.  
OK, let’s run python with redis.

```
import redis
r = redis.StrictRedis(host = '127.0.0.1', port = 6379, db = 0);
r.set('name','kem')
print(r.get('name'))
```

result:kem

redis server: