1. 下载setuptools及pip的源码包
	setuptools与pip都是python的模块
	setuptools源码包: https://pypi.python.org/pypi/setuptools
	pip源码包: https://pypi.python.org/pypi/pip#downloads
2. 安装setuptools与pip
目前下载的版本是setuptools-12.0.5.tar.gz与pip-6.0.6.tar.gz
用tar命令解压, 格式:tar -xzvf xxxx.tar.gz
先安装setuptools, 进行setuptools的源码根目录下, 执行以下命令进行setuptools模块的安装:
  1. # python setup.py install
安装完setuptools后, 接着安装pip, 进入pip的源码包根目录下, 执行以下命令进行安装:
  1. # python setup.py build
  2. # python setup.py install
安装完pip后. 看看pip都安装在哪里. 执行以下命令:
  1. # whereis pip
然后再执行 # pip  命令并回车, 如果无法用pip命令, 则可通过创建pip软链接, 执行以下命令:
  1. # ln -s /usr/local/bin/pip /usr/bin/pip
好啦, 检测pip命令是否正常:
  1. # pip
  2. Usage:
  3. pip <command> [options]
  4. Commands:
  5. install                     Install packages.
  6. uninstall                   Uninstall packages.
  7. freeze                      Output installed packages in requirements format.
  8. list                        List installed packages.
  9. show                        Show information about installed packages.
  10. search                      Search PyPI for packages.
  11. wheel                       Build wheels from your requirements.
  12. zip                         DEPRECATED. Zip individual packages.
  13. unzip                       DEPRECATED. Unzip individual packages.
  14. help                        Show help for commands.
  15. General Options:
  16. -h, --help                  Show help.
  17. --isolated                  Run pip in an isolated mode, ignoring
  18. environment variables and user configuration.
  19. -v, --verbose               Give more output. Option is additive, and can be
  20. used up to 3 times.
  21. -V, --version               Show version and exit.
  22. -q, --quiet                 Give less output.
  23. --log <path>                Path to a verbose appending log.
  24. --proxy <proxy>             Specify a proxy in the form
  25. [user:passwd@]proxy.server:port.
  26. --retries <retries>         Maximum number of retries each connection should
  27. attempt (default 5 times).
  28. --timeout <sec>             Set the socket timeout (default 15 seconds).
  29. --exists-action <action>    Default action when a path already exists:
  30. (s)witch, (i)gnore, (w)ipe, (b)ackup.
  31. --trusted-host <hostname>   Mark this host as trusted, even though it does
  32. not have valid or any HTTPS.
  33. --cert <path>               Path to alternate CA bundle.
  34. --client-cert <path>        Path to SSL client certificate, a single file
  35. containing the private key and the certificate
  36. in PEM format.
  37. --cache-dir <dir>           Store the cache data in <dir>.
  38. --no-cache-dir              Disable the cache.
  39. --disable-pip-version-check
  40. Don't periodically check PyPI to determine
  41. whether a new version of pip is available for
  42. download. Implied with --no-index.
如果不创建软链接, 也可以直接使用pip的路径来执行命令也是可以的, 如下:
  1. # /usr/local/bin/pip
  2. Usage:
  3. pip <command> [options]
  4. Commands:
  5. install                     Install packages.
  6. uninstall                   Uninstall packages.
  7. freeze                      Output installed packages in requirements format.
  8. list                        List installed packages.
  9. show                        Show information about installed packages.
  10. search                      Search PyPI for packages.
  11. wheel                       Build wheels from your requirements.
  12. zip                         DEPRECATED. Zip individual packages.
  13. unzip                       DEPRECATED. Unzip individual packages.
  14. help                        Show help for commands.
  15. General Options:
  16. -h, --help                  Show help.
  17. --isolated                  Run pip in an isolated mode, ignoring
  18. environment variables and user configuration.
  19. -v, --verbose               Give more output. Option is additive, and can be
  20. used up to 3 times.
  21. -V, --version               Show version and exit.
  22. -q, --quiet                 Give less output.
  23. --log <path>                Path to a verbose appending log.
  24. --proxy <proxy>             Specify a proxy in the form
  25. [user:passwd@]proxy.server:port.
  26. --retries <retries>         Maximum number of retries each connection should
  27. attempt (default 5 times).
  28. --timeout <sec>             Set the socket timeout (default 15 seconds).
  29. --exists-action <action>    Default action when a path already exists:
  30. (s)witch, (i)gnore, (w)ipe, (b)ackup.
  31. --trusted-host <hostname>   Mark this host as trusted, even though it does
  32. not have valid or any HTTPS.
  33. --cert <path>               Path to alternate CA bundle.
  34. --client-cert <path>        Path to SSL client certificate, a single file
  35. containing the private key and the certificate
  36. in PEM format.
  37. --cache-dir <dir>           Store the cache data in <dir>.
  38. --no-cache-dir              Disable the cache.
  39. --disable-pip-version-check
  40. Don't periodically check PyPI to determine
  41. whether a new version of pip is available for
  42. download. Implied with --no-index.
如果运气不好, 出现如下信息:
  1. ImportError: No module named 'pip._vendor.requests'
这是因为openssl模块没安装好, 可执行以下命令来安装:
  1. # yum install openssl-devel
  
  
OK, Enjoy it!!!

最新文章

  1. jquery html属性和text属性的区别
  2. psql-07表:分区表
  3. S2 第二章数据库的实现
  4. ado.net工厂模式DbProviderFactories
  5. JavaEDU614 团队第三周项目总结
  6. Linux系统编程(26)——守护进程
  7. JavaScript基础知识----六道有趣的Js基础题以及解答
  8. JSP servlet的配置与使用
  9. Zend引擎探索 之 PHP中前置递增不返回左值
  10. 安装wamp环境 最新完整版
  11. kubernetes in action - Pods
  12. 关于java poi itext生成pdf文件的例子以及方法
  13. R12.1.3 &amp; R12.2.X 注册客户化应用
  14. SQL中的字母的大小写转换
  15. 使用Maven+ssm框架搭建一个web项目
  16. CF888G Xor-MST 解题报告
  17. CentOS 7 下编译安装lnmp之PHP篇详解
  18. ios中base64编码
  19. 【linux】——一个小程序
  20. Golang 包依赖管理工具

热门文章

  1. WdatePicker时间插件
  2. 个人Vue-1.0学习笔记
  3. dede后台出现   保存目录数据时失败,请检查你的输入资料是否存在问题
  4. ==和equals详解+例子
  5. Netty 拆包粘包和服务启动流程分析
  6. Windows10下用Anaconda3安装TensorFlow教程
  7. RocketMQ-消费重试机制
  8. linu_nginx_location语法
  9. 新建maven项目,JRE System Library[J2SE-1.5]
  10. sp_getAppLock使用