Ubuntu上面安装Redis Python

Ubuntu上面安装Redis Python

1,下载redis源码https://redis.io/download,下载地址:http://124.205.69.169/files/A0920000066BC41D/download.redis.io/releases/redis-4.0.8.tar.gz

2,在Ubuntu上面解压 tar -xzf redis-4.0.8.tar.gz

cd redis-4.0.8

make '编译Redis

sudo make install  ‘安装Redis

redis-server redis.conf  '启动Reids服务器 

3,python已经默认安装了;

4,为Python安装Redis客户端

wget -q http://peak.telecommunity.com/dist/ez_setup.py

sudo python ez_setup.py

如果出现403 SSL is required,vi修改一下,把http修改为https

用easy_install 安装redis , hiredis出现问题;

改用pip进行redis,hiredis安装;

5,安装pip

sudo apt-get install python-pip

6,使用pip安装hiredis

sudo pip install hiredis

7,使用pip安装redis失败

8,安装git

sudo apt-get install git

9,使用源码安装

学习了:http://blog.csdn.net/chosen0ne/article/details/7319807

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

cd redis-py/

sudo python setup.py install

安装完毕

10,安装后测试

python

>>> import redis

>>>conn=redis.Redis()

>>>conn.set('hello','world')

True

>>>conn.get('hello')

'world'

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值