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!!!

centos6下从源码安装setuptools和pip的更多相关文章

  1. Centos6.6上源码安装Nodejs V4版本

    本来就是想在vps上装一个Ghost博客,这个博客依赖的是Nodejs,然后推荐的是V4版本.然后我就对着官网的步骤安装,发现根本没有Centos6 i386的资源了(64位的还是有的), 我只能在那 ...

  2. RedHat7下PostGIS源码安装

    本文介绍在RedHat7环境下安装使用PostGIS的流程. 1. PostgreSQL 1.1 yum安装PostgreSQL 这个比较简单,直接使用yum安装即可. $ sudo yum inst ...

  3. debian下如何源码安装tmux

    一.源码安装ncurses库 1.1 获取源码 wget https://invisible-island.net/datafiles/release/ncurses.tar.gz tar xvf n ...

  4. Cenos(6.6/7.1)下从源码安装Python+Django+uwsgi+nginx到写nginx的环境部署(一)

    梳理下这几个的关系: centos是redhat的社区版操作系统. Python2.7.5是开发语言(centos6.5下自带的python是2.6.6版本,所以需要源码更新,而centos7.1下面 ...

  5. Linux(CentOS或RadHat)下MySQL源码安装

    安装环境: CentOS6.3 64位 软件: Mysql-5.6 所需包: gcc/g++ :MySQL 5.6开始,需要使用g++进行编译.cmake  :MySQL 5.5开始,使用cmake进 ...

  6. linux下如何源码安装expect

    1.作用 自动交互.比如如果用ssh登陆服务器,每次都输入密码,然而你觉得麻烦,那你就可以使用expect来做自动交互,这样的话就不用每次都输入密码 2.依赖 依赖tcl 3.获取源码 wget ht ...

  7. Windows下sklearn源码安装

    简介 在Windows下编译sklearn源码,主要注意二点: 编译环境的搭建 编译顺序 编译环境的搭建 如果环境没有搭建好,最常见的报错,就是"error: Unable to find ...

  8. centos下kong源码安装

    参考资料: https://docs.konghq.com/install/source/ 环境准备:操作系统 centeros7.3 1 :openssl和pcre一般系统自带,如果没有可自己安装  ...

  9. Ubuntu 14.04下从源码安装qt4.x

    转自:http://www.cnblogs.com/crazywangzx/p/3505293.html 1.到官网http://qt-project.org/downloads或者ftp://ftp ...

随机推荐

  1. 各大型邮箱smtp服务器及端口收集

    >新浪邮箱smtp服务器 外发服务器:smtp.vip.sina.com 收件服务器:pop3.vip.sina.com 新浪免费邮件 外发服务器:smtp.sina.com.cn 收件服务器: ...

  2. nginx.conf文件

    user  www www; worker_processes auto; error_log  /home/wwwlogs/nginx_error.log  crit; pid        /us ...

  3. java垃圾回收的分类

    1.线程数 分为串行垃圾回收器和并行垃圾回收器.串行垃圾回收器一次只使用一个线程进行垃圾回收:并行垃圾回收器一次将开启多个线程同时进行垃圾回收.在并行能力较强的 CPU 上,使用并行垃圾回收器可以缩短 ...

  4. 疑难杂症——关于EntityFramework的SqlQuery方法的执行效率差异的探讨

    前言:最近项目上面遇到一个问题,在Code First模式里面使用EntityFramework的SqlQuery()方法查询非常慢,一条数据查询出来需要10秒以上的时间,可是将sql语句放在plsq ...

  5. JS题目

    1.请你谈谈Cookie的弊端 cookie虽然在持久保存客户端数据提供了方便,分担了服务器存储的负担,但还是有很多局限性的. 第一:每个特定的域名下最多生成20个cookie 1.IE6或更低版本最 ...

  6. JavaScript 函数创建思想

    //定义一个函数的步骤//1.开辟一个新的空间地址//2.把函数体里面的代码当做字符串存储到空间里面(一个函数如果只定义了,没有执行的话,这个函数没有任何意义)//3.在把我们的地址给我们的函数名fu ...

  7. 【转】GPS基线解算模式

    GPS基线向量是利用2台或2台以上GPS接 收机所采集的同步观测数据形成的差分观测值,通过参数估计得方法所计算出的两两接收机间的三维坐标差.与常规地面测量中所测定的基线边长不同,基线向量是 既具有长度 ...

  8. final修饰符,多态,抽象类,接口

    1:final关键字(掌握)    (1)是最终的意思,可以修饰类,方法,变量.    (2)特点:        A:它修饰的类,不能被继承.        B:它修饰的方法,不能被重写.      ...

  9. python selenium 鼠标悬停

    #鼠标悬停 chain = ActionChains(driver) implement = driver.find_element_by_link_text() chain.move_to_elem ...

  10. C语言打印不出百分号'%'(以解决)

    1. 问题描述 今天,我需要把百分号'%'打印出来,考虑到它是特殊符号,我就用转义字符'\',和它组合,结果是漆黑的屏幕什么也没有. 2. 解决办法    我问度娘, 她告诉我要打印百分号需要在它的前 ...