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 ...
随机推荐
- VUE之ECMAScript6(es6)
es6:es:EMCAScript 6 (es2015)Emca:国际标准组织 1.常量和变量 const a = "hello" let:定义一个块级作用域的变量 需要先定义再使 ...
- ADO.NET复习总结(4)--访问SqlServer的类
1.连接SqlConnection 2. 3.执行命令SqlCommand 4.数据读取SqlDataReader 注意: ExecuteNonQuery() :执行非查询(增删改) Execute ...
- [one day one question] nodejs require 缓存,无法检测文件变化
问题描述: nodejs require 缓存,无法检测文件变化,当文件require引入后,当文件发生变动后即使再次使用require,返回的依然是第一次引入的文件内容,这怎么破? 解决方案: de ...
- vuex Loding加载..
技术栈:vuex,mapActions, mapState 先在vuex的状态管理里定义好loding状态,以及加载文字 import Vue from 'vue'; import Vuex from ...
- JavaScript Date 时间对象方法
Date(日期/时间对象) Date 操作日期和时间的对象 Date.getDate( ) 返回一个月中的某一天 Date.getDay( ) 返回一周中的某一天 Date.getFullYear( ...
- ESP8266重点知识
每一个mcu对应一个库文件,所以每次上传烧写arduino都需要对应的库文件,修改起来很麻烦,不如记录下来每次的库文件,或者每次都自动生成.这样效果最佳.而且我想应该是比较稳定的, 现在比较朦胧一个问 ...
- CentOS7.x机器安装Azure CLI2.0
安装Azure CLI 2.0的前提是:机器中必须有 Python 2.7.x 或 Python 3.x.如果机器中没有其中任何一个Python的版本,请及时安装 1.准备一台CentOS 7.3的机 ...
- libev-4.20编译安装及简单使用
1.源码下载地址: http://www.csdn.net/tag/libev/download 2.库的编译与安装 解压文件,进入文件目录 编译的时候需要首先切换为管理员(root)账户,然后执行以 ...
- awk说明书(转)
ref:http://blog.chinaunix.net/uid-429659-id-122573.html awk使用手册 作者:awk使用手册什么是awk? 你可能对UNIX比较熟悉,但你可能对 ...
- python--批量下载豆瓣图片之升级版本
周末下雨没法出门,刷刷豆瓣看看妹子,本想拿以前脚本下载点图片,结果发现运行失败,之前版本为<python--批量下载豆瓣图片>,报错HTTP Error 403: Forbidden,网上 ...