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