centos6下从源码安装setuptools和pip
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模块的安装:
- # python setup.py install
安装完setuptools后, 接着安装pip, 进入pip的源码包根目录下, 执行以下命令进行安装:
- # python setup.py build
- # python setup.py install
安装完pip后. 看看pip都安装在哪里. 执行以下命令:
- # whereis pip
然后再执行 # pip 命令并回车, 如果无法用pip命令, 则可通过创建pip软链接, 执行以下命令:
- # ln -s /usr/local/bin/pip /usr/bin/pip
好啦, 检测pip命令是否正常:
- # 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.
- zip DEPRECATED. Zip individual packages.
- unzip DEPRECATED. Unzip individual packages.
- 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.
如果不创建软链接, 也可以直接使用pip的路径来执行命令也是可以的, 如下:
- # /usr/local/bin/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.
- zip DEPRECATED. Zip individual packages.
- unzip DEPRECATED. Unzip individual packages.
- 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.
如果运气不好, 出现如下信息:
- ImportError: No module named 'pip._vendor.requests'
这是因为openssl模块没安装好, 可执行以下命令来安装:
- # yum install openssl-devel
OK, Enjoy it!!!
centos6下从源码安装setuptools和pip的更多相关文章
- Centos6.6上源码安装Nodejs V4版本
本来就是想在vps上装一个Ghost博客,这个博客依赖的是Nodejs,然后推荐的是V4版本.然后我就对着官网的步骤安装,发现根本没有Centos6 i386的资源了(64位的还是有的), 我只能在那 ...
- RedHat7下PostGIS源码安装
本文介绍在RedHat7环境下安装使用PostGIS的流程. 1. PostgreSQL 1.1 yum安装PostgreSQL 这个比较简单,直接使用yum安装即可. $ sudo yum inst ...
- debian下如何源码安装tmux
一.源码安装ncurses库 1.1 获取源码 wget https://invisible-island.net/datafiles/release/ncurses.tar.gz tar xvf n ...
- Cenos(6.6/7.1)下从源码安装Python+Django+uwsgi+nginx到写nginx的环境部署(一)
梳理下这几个的关系: centos是redhat的社区版操作系统. Python2.7.5是开发语言(centos6.5下自带的python是2.6.6版本,所以需要源码更新,而centos7.1下面 ...
- Linux(CentOS或RadHat)下MySQL源码安装
安装环境: CentOS6.3 64位 软件: Mysql-5.6 所需包: gcc/g++ :MySQL 5.6开始,需要使用g++进行编译.cmake :MySQL 5.5开始,使用cmake进 ...
- linux下如何源码安装expect
1.作用 自动交互.比如如果用ssh登陆服务器,每次都输入密码,然而你觉得麻烦,那你就可以使用expect来做自动交互,这样的话就不用每次都输入密码 2.依赖 依赖tcl 3.获取源码 wget ht ...
- Windows下sklearn源码安装
简介 在Windows下编译sklearn源码,主要注意二点: 编译环境的搭建 编译顺序 编译环境的搭建 如果环境没有搭建好,最常见的报错,就是"error: Unable to find ...
- centos下kong源码安装
参考资料: https://docs.konghq.com/install/source/ 环境准备:操作系统 centeros7.3 1 :openssl和pcre一般系统自带,如果没有可自己安装 ...
- Ubuntu 14.04下从源码安装qt4.x
转自:http://www.cnblogs.com/crazywangzx/p/3505293.html 1.到官网http://qt-project.org/downloads或者ftp://ftp ...
随机推荐
- PHP中put和post区别
1. 使用支持和范围的区别: PHP提供了对PUT方法的支持,在Http定义的与服务器的交互方法中,PUT是把消息本体中的消息发送到一个URL,形式上跟POST类似; PHP 提供对诸如 Netsca ...
- 阿里云部署SSL证书详解
http://mp.weixin.qq.com/s/NV7Zad4DVEgzG2GCHYJVLw 查找中间证书 为了确保兼容到所有浏览器,我们必须在阿里云上部署中间证书,如果不部署证书,虽然安装过程可 ...
- DEDECMS系统安全篇之移data目录到Web根目录以外听语音
http://jingyan.baidu.com/article/ad310e80aeb0971849f49e8e.html 主要三个步骤: 1./include/common.inc.php 2.还 ...
- C语言第二次实验报告
1.实验题目 题1:11-7 找鞍点(20 分) 一个矩阵元素的"鞍点"是指该位置上的元素值在该行上最大.在该列上最小. 本题要求编写程序,求一个给定的n阶方阵的鞍点 题2: ...
- 查询A、B表中,A表中B表没有的数据
A.B两表,找出ID字段中,存在A表,但是不存在B表的数据.A表总共13w数据,去重后大约3W条数据,B表有2W条数据,且B表的ID字段有索引. 方法一 使用 not in ,容易理解,效率低 ~执 ...
- xtrabackup全量备份和增(差)量备份
xtrabackup全量备份和增(差)量备份 1.xtrabackup全量备份和恢复 1)备份: innobackupex --default-file=/PATH/TO/DEFAULT --host ...
- windows下搭建virtualenv虚拟环境
操作系统:windows7 旗舰版 64bit pip install django==1.9.1pip install virtualenv 虚拟环境工具>pip install virtua ...
- python3 第十二章 - 数据类型之List(列表)
Python内置的一种数据类型是列表:list. list是一种有序的集合 可以随时添加和删除其中的元素. 它可以作为一个方括号内的逗号分隔值出现. 列表的数据项不需要具有相同的类型 创建一个列表,只 ...
- sitemesh网页布局
看项目时发现对应页面下找不到侧栏部分代码,仔细观察后发现页面引入了sitemesh标签,查了下资料原来是页面用了sitemesh框架解!耦!了! 以前多个模块包含相同模块时总是include jsp文 ...
- Servlet--Servlet接口
servlet主要数据结构 Servlet 接口:主要定义了servlet的生命周期方法 ServletConfig接口:为servlet提供了使用容器服务的若干重要对象和方法. ServletCon ...