首页 > 系统服务 > 详细

ubuntu中pip安装redis-py及pip的使用

时间:2016-02-28 22:39:58      阅读:248      评论:0      收藏:0      [点我收藏+]

安装redis-py的前提是已经将redis成功安装,redis安装过程请看博文

  ubuntu14安装redis

1.安装pip

sudo apt-get install python-pip

 

2.使用pip安装redis-py

sudo pip install redis

 

3.此时便可以在python中使用redis了

 1 pc@pc-virtual-machine:~/Desktop$ python
 2 Python 2.7.6 (default, Jun 22 2015, 18:00:18) 
 3 [GCC 4.8.2] on linux2
 4 Type "help", "copyright", "credits" or "license" for more information.
 5 >>> import redis
 6 >>> r = redis.Redis(host = "localhost")
 7 >>> r.set("name","good night");
 8 True
 9 >>> r.get("name")
10 good night
11 >>> 

 

4.pip的使用详解

4.1pip安装包

  pip install SomePackage

      [...]
  Successfully installed SomePackage
 
4.2 pip检查哪些包需要升级
  pip list --outdate
 
4.3 pip升级包
  pip install --upgrade SomePackage
 
4.4 pip卸载包
  pip uninstall SomePackage
  Uninstalling SomePackage:
    /my/env/lib/pythonx.x/site-packages/somepackage
  Proceed (y/n)? y
  Successfully uninstalled SomePackage
 
4.5 pip帮助
  

pip --help

Usage:
pip <command> [options]

Commands:
install Install packages.
download Download 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.
hash Compute hashes of package archives.
help Show help for commands.

 

 

 

 

ubuntu中pip安装redis-py及pip的使用

原文:http://www.cnblogs.com/zhaopengcheng/p/5225737.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!