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 ...
随机推荐
- 在Pycharm中运行Scrapy爬虫项目的基本操作
目标在Win7上建立一个Scrapy爬虫项目,以及对其进行基本操作.运行环境:电脑上已经安装了python(环境变量path已经设置好), 以及scrapy模块,IDE为Pycharm .操作如下: ...
- 在windows64位Anaconda3环境下安装XGBoost
安装步骤参考的是: "Installing XGBoost For Anaconda on Windows":https://www.ibm.com/developerworks/ ...
- 【原创】区分png图片格式和apng图片格式的解决办法
最近公司有个项目,要抓取客户微信公众号的文章,以及文章内容中的图片,并且在图片加上客户自己的水印.我们使用阿里云OSS存储图片和加水印,发现真心好用,提升了我们的开发效率,阿里云现在是越来越强大了.. ...
- mysql-冗余和重复索引
mysql允许在相同列上创建多个索引,无论是有意还是无意,mysql需要单独维护重复的索引,并且优化器在优化查询的时候也需要逐个地进行考虑,这会影响性能. 重复索引是指的在相同的列上按照相同的顺序创建 ...
- CDuiString和String的转换
很多时候 难免用到CDuiString和string的转换. 我们应该注意到,CDuiString类有个方法: LPCTSTR GetData() const; 可以通过这个方法,把CDuiStrin ...
- SSM与jsp传递实体类
jsp传controller Controller: @RequestMapping({"/user"}) public void registerUser(User uu) th ...
- Execption:the database returned no natively generated identity value
org.hibernate.HibernateException: The database returned no natively generated identity value at org. ...
- 学会用git真的很重要
一.首先,作为一名开发人员,目前个人菜鸟一个,觉得有个仓库来管理好自己的项目是真的很重要,而目前个人认为在git上面管理自己的项目是真的很不错的推荐,接下来给大家介绍一下如何使用git上传.管理自己的 ...
- sed,n,N,d,D,p,P,h,H,g,G,x,解析
原文地址 这篇文章主要是我参考命令的,直接复制粘贴,有问题请拍砖 A. sed执行模板=sed '模式{命令1;命令2}' 即逐行读入模式空间,执行命令,最后输出打印出来 B. p打印当前模式空间所有 ...
- 【视频编解码·学习笔记】4. H.264的码流封装格式
一.码流封装格式简单介绍: H.264的语法元素进行编码后,生成的输出数据都封装为NAL Unit进行传递,多个NAL Unit的数据组合在一起形成总的输出码流.对于不同的应用场景,NAL规定了一种通 ...