所用系統: centos-6.7
python
系統自帶Python版本 :Python 2.6.6redis
1. pip是什麼?centos
-- pip是一個安裝和管理Python 包的工具,是easy_install的替代品.ide
2.pip安裝步驟:工具
1)下載pip(直接使用wget從網站下載)
學習
# wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate
2)pip安裝網站
#tar -xf pip-1.5.4.tar.gz
#cd pip-1.5.4
#python setup.py installui
在安裝pip的時候容易出錯,報錯以下:orm
[root@1e supervisor-3.0]# python setup.py install Traceback (most recent call last): File "setup.py", line 31, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools
分析: 此提示是缺乏setuptools,咱們能夠從官網下載工具進行安裝blog
下載地址: https://pypi.python.org/pypi/setuptools#downloads
下載的版本是setuptools-36.27.zip 直接解壓就能夠安裝
# unzip setuptools-36.2.7.zip
# cd setuptools-36.2.7
#python setup.py install
安裝好後,就能夠在返回第2步,直接安裝pip
#python setup.py install
[root@localhost pip-1.5.4]# pip -V
pip 1.5.4 from /usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg (python 2.6)
能夠看到pip已經安裝成功了
使用方法:
1) pip 查看已安裝的軟件
[root@localhost pip-1.5.4]# pip show --files python
---
Name: Python
Version: 2.6.6
Location: /usr/lib64/python2.6/lib-dynload
Requires:
Files:
Cannot locate installed-files.txt
2) pip查看幫助
[root@localhost pip-1.5.4]# pip --help
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.
bundle DEPRECATED. Create pybundles.
help Show help for commands.
好比要安裝redis
#pip install redis
安裝就是這麼easy,以上就是pip安裝的所有內容,但願本文的內容對你們的學習或者工做能帶來必定的幫助,若是有疑問能夠留言交流.