安装 python 的 redis 客户端
1,下载 ez_setup.py
wget -q http://peak.telecommunity.com/dist/ez_setup.py
2, 运行 ez_setup.py 安装 setuptools
sudo python ez_setup.py
Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Processing setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin
Installed /usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
3,通过运行 setuptools 的easy_install 包来安装 redis 包以及 hiredis包
redis 包为 Python 提供了一个连接至 Redis 的接口。
hiredis包 是一个 C 库,它可以提高 Python de Redis 客户端的速度。
sudo python -m easy_install redis hiredis
Searching for redis
Reading http://pypi.python.org/simple/redis/
Best match: redis 2.10.5
Downloading https://pypi.python.org/packages/68/44/5efe9e98ad83ef5b742ce62a15bea609ed5a0d1caf35b79257ddb324031a/redis-2.10.5.tar.gz#md5=3b26c2b9703b4b56b30a1ad508e31083
Processing redis-2.10.5.tar.gz
Running redis-2.10.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-cGi0Hb/redis-2.10.5/egg-dist-tmp-uJ77Ej
warning: no previously-included files found matching '__pycache__'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
zip_safe flag not set; analyzing archive contents...
Adding redis 2.10.5 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/redis-2.10.5-py2.7.egg
Processing dependencies for redis
Finished processing dependencies for redis
Searching for hiredis
Reading http://pypi.python.org/simple/hiredis/
Best match: hiredis 0.2.0
Downloading https://pypi.python.org/packages/1b/98/4766d85124b785ff1989ee1c79631a1b6ecfcb444ff39999a87877b2027e/hiredis-0.2.0.tar.gz#md5=b410cf2f2062d87ab841c33d8345761e
Processing hiredis-0.2.0.tar.gz
Running hiredis-0.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-4qp8i2/hiredis-0.2.0/egg-dist-tmp-QDdm7R
warning: no previously-included files found matching 'vendor/hiredis/example*'
warning: no previously-included files found matching 'vendor/hiredis/text*'
In file included from src/hiredis.c:1:0:
src/hiredis.h:4:20: fatal error: Python.h: 没有那个文件或目录
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
问题解决:
方法一 (未起作用)
gao@gao-VirtualBox:/var/www/redis-3.2.3/deps/hiredis$ sudo make install
mkdir -p /usr/local/include/hiredis /usr/local/lib
cp -a hiredis.h async.h adapters /usr/local/include/hiredis
cp -a libhiredis.so /usr/local/lib/libhiredis.so.0.11
cd /usr/local/lib && ln -sf libhiredis.so.0.11 libhiredis.so.0
cd /usr/local/lib && ln -sf libhiredis.so.0 libhiredis.so
cp -a libhiredis.a /usr/local/lib
gao@gao-VirtualBox:/var/www/redis-3.2.3/deps/hiredis$
方法(二)
gao@gao-VirtualBox:/var/www$ sudo apt-get install python-dev gao@gao-VirtualBox:/var/www$ sudo python -m easy_install hiredis
Searching for hiredis
Reading http://pypi.python.org/simple/hiredis/
Best match: hiredis 0.2.0
Downloading https://pypi.python.org/packages/1b/98/4766d85124b785ff1989ee1c79631a1b6ecfcb444ff39999a87877b2027e/hiredis-0.2.0.tar.gz#md5=b410cf2f2062d87ab841c33d8345761e
Processing hiredis-0.2.0.tar.gz
Running hiredis-0.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-NF3WyD/hiredis-0.2.0/egg-dist-tmp-k5KIsj
warning: no previously-included files found matching 'vendor/hiredis/example*'
warning: no previously-included files found matching 'vendor/hiredis/text*'
zip_safe flag not set; analyzing archive contents...
Adding hiredis 0.2.0 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/hiredis-0.2.0-py2.7-linux-x86_64.egg
Processing dependencies for hiredis
Finished processing dependencies for hiredis
相关推荐
redis-py:Redis 的 Python 客户端
asyncio-redis, python asyncio的Redis客户端( PEP 3156 ) 用于 python asyncio的客户端。 用于 PEP 3156 事件循环的Redis客户端。这个Redis库是一个完全异步,非阻塞的客户端Redis服务器。 它依赖于 asyncio ( PEP ...
掌阅科技 python 接入 redis 客户端项目描述实现redis接入以及redis的failover机制实现redis客户端级别的负载均衡解决长连接失效后需要重启服务问题提供redis的基础model层支持codis项目当前状态服务线上所有redis的...
aredis 是一款基于 Python 3.5 及以上的 redis 客户端,利用了 Python 提供的协程及事件循环来避免在 redis 操作上等待多余的 io,使代码运行得更加迅速。
credis 是使用 cython 开发的 Redis 的 Python 客户端开发包。示例代码:>>> from credis import Connection >>> conn = Connection(host='127.0.0.1', port=6379) >>> conn.execute('set', 'test', 1)...
### Redis Python 客户端:Redis 键值存储的 Python 接口 Redis 是一个高性能的键值存储系统,广泛应用于缓存、消息队列、实时分析等场景。在 Python 中,可以通过多个客户端库与 Redis 进行交互,其中最流行的是 `...
Redis是一个开源的使用ANSI ...它提供了Java,C/C++,C#,PHP,JavaScript,Perl,Object-C,Python,Ruby,Erlang等客户端,使用很方便。此处提供了redis的命令行界面客户端以及服务端应用。欢迎各位工程师下载使用!
txRedis:基于 Twisted 的 Redis 客户端
一个redis客户端实现,设计于使用micropython。
阿雷迪斯 从 (这是Redis键值的Python接口)移植的高效且用户友好的异步redis客户端要获取更多信息,请阅读安装aredis需要运行中的Redis服务器。 要安装aredis,只需: $ pip3 install aredis[hiredis] 或从来源: $...
aredis 是一款基于 Python 3.5 及以上的 redis 客户端,利用了 Python 提供的协程及事件循环来避免在 redis 操作上等待多余的 io,使代码运行得更加迅速。aredis 的优势在于其 api 部分沿袭了 redis-py 的 api 设计...
异步redis 用于 Python 的异步 Redis 客户端
一站式学习Redis 从入门...包含Redis基础,使用经验介绍、Java,Python客户端示范、Redis使用规范,由浅入深讲解并伴有企业中Redis开发的相关项目以及大规模Redis的实战经验,是开发和运维人员系统学习Redis的必备内容
切换redis后客户端长连接仍旧与旧的服务端保持连接,使用此程序可以从旧的redis服务端断开所有客户端链接。
主要介绍了Redis的Python客户端redis-py安装使用说明文档,本文讲解了安装方法、入门使用实例、API参考和详细说明,需要的朋友可以参考下
该客户端提供了Redis 3.0中添加的Redis集群客户端。 该项目是antirez的redis-rb-cluster的移植版,具有许多附加功能。 原始资源可以在找到 分支master将始终包含已从Pull Requests中合并的最新不稳定/开发代码。 ...
aredis 是一款由同步的 redis 客户端 redis-py 改写而成的高效的异步 redis 客户端,在最新的 1.0.7 版本中完成了对于 redis 集群的支持。 改动 主要重写了底部建立连接和读取数据部分的代码,接口部分都向下兼容,...
ssdb-ya-又一个 ssdb 的 Python 客户端. 用来替代 Redis 的 NoSQL 数据库.
一个简单的Redis开发脚本示例,它使用Redis的Python客户端库redis-py来执行一些基本的Redis操作,如设置键值对、获取键的值、增加计数器等。
redis