redis-py 的安装 | 珊瑚贝

对于 Redis 来说,我们要使用 redis-py 库来与其交互,本节我们来介绍一下 redis-py 的安装方法。

相关链接

安装方法

pip 安装

推荐使用 pip3 安装,命令如下:

1
pip3 install redis

运行完毕之后即可完成 redis-py 的安装。

验证安装

为了验证库是否已经安装成功,可以在命令行下测试一下:

1
2
3
4
5
$ python3
>>> import redis
>>> redis.VERSION
(2, 10, 6)
>>>

在命令行首先输入 python3,进入命令行模式,输入如上内容,如果成功输出了其版本内容,那么证明 redis-py 成功安装。

来源:https://cuiqingcai.com/31045.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_11552.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?