pip安装Python模块的工具,等价于Redhat中的yum!
01、下载
百度云盘:http://pan.baidu.com/s/1eRHGBfk ###相关的
Linux很多都默认安装Python,python -V #查看python版本
python
https://www.python.org/downloads/source/
Python-2.6.6.tgz :点击下载
Python2.7.13 :点击下载
tar Jxf Python-2.7.13.tar.xz
./configure && make && make install
setuptools
https://pypi.python.org/pypi/setuptools
###setuptools的作用:Easily download, build, install, upgrade, and uninstall Python packages
setuptools-32.3.0.zip:点击下载
###报错提示
[root@bang pip-9.0.1]# python setup.py install
Traceback (most recent call last):
File "setup.py", line 6, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
###解决方案
安装setuptools
unzip setuptools-32.3.0.zip
cd setuptools
python setup.py install
pip
https://pypi.python.org/pypi/pip
pip-9.0.1.tar.gz:点击下载
https://pip.pypa.io/en/stable/ ###pip官方文档
tar zxf pip-9.0.1.tar.gz
python setup.py install
02、pip用法:
--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 install --cacahe-dir . shinken*.tar.gz ###安装本地的python编写的文件
03、配置pip源
pip源,采用阿里云的pip源用于加速下载文件
阿里云:http://mirrors.aliyun.com/help/pypi
在~/.pip/pip.conf
[global] index-url = http://mirrors.aliyun.com/pypi/simple/
[install] trusted-host=mirrors.aliyun.com
04、采用yum或apt-get
yum install -y python-setuptools python-pip
apt-get install python-setuptools python-pip