mac os安装redis及python安装redis库
来源:互联网 发布:c语言unsigned什么意思 编辑:程序博客网 时间:2024/06/05 10:52
安装方式是基于brew的,所以先要确保系统已经安装brew
1.安装redis
brew install redis
2.创建链接并添加到开机启动
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
3.启动服务
执行完后服务一般就已经启动
如果自己启动的话执行命令:
redis-server
4.客户链接测试
执行
redis-cli
结果:
MacBook-Pro:Cellar$ redis-cli
127.0.0.1:6379>set aa 'a'
OK
127.0.0.1:6379> get aa
"a"
127.0.0.1:6379> del aa
(integer) 1
sudo easy_install pip
MacBook-Pro:local$ pip
Usage:
pip <command> [options]
Commands:
install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
wheel Build wheels from your requirements.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring
environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be
used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output.
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should
attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup.
--trusted-host <hostname> Mark this host as trusted, even though it does
not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
sudo pip install redis
测试一下:
MacBook-Pro:~ $ python
Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>>
>>> import redis
>>> conn=redis.Redis()
>>> conn.set('a','hello,world')
True
>>> conn.get('a')
'hello,world'
>>>
- mac os安装redis及python安装redis库
- mac os安装Redis
- Mac OS 简易安装redis
- Mac OS X安装Redis
- Redis-安装 Mac os x
- mac os 快速安装redis
- redis 安装(mac os 下教程)
- MAC OS下安装Redis 2.8
- Mac OS X安装redis-php扩展
- 在Mac os x 安装 Redis
- Mac Xampp 安装redis 及 安装php-redis扩展
- mac redis安装及简易使用
- Mac下安装redis
- Mac下安装redis
- mac 安装redis扩展
- mac 安装redis服务
- mac 下安装redis
- mac安装redis
- volatile 关键字
- asp.net(C#)页面事件顺序
- Android 讲解:Activity 的启动方式
- Struts标签
- 使用weight 让linearlayout内部的控件居中显示
- mac os安装redis及python安装redis库
- 你就这样做!
- 【第七章】 对JDBC的支持 之 7.5 集成Spring JDBC及最佳实践 ——跟我学spring3
- shell 脚本知识点
- IE “浏览器模式”和“文档模式”的区别
- 浅谈 Linux 系统中的 SNMP Trap
- 删除不存在的远程分支
- 队列定义
- Unity调用Android录音