时间:2021-07-01 10:21:17 帮助过:61人阅读
今天来说一下,pip的安装方法。
方法一:脚本安装
$ wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py $ [sudo] python get-pip.py
方法二:源码安装:
$ curl -O https://pypi.python.org/packages/source/p/pip/pip-X.X.tar.gz $ tar xvfz pip-X.X.tar.gz $ cd pip-X.X $ python setup.py install
但是安装过程可能会出现错误:
An error occurred while trying to run get-pip.py. Make sure you have setuptools or distribute installed.
出现这个错误,说明首先要安装setuptools
setuptools 安装:
wget -q http://peak.telecommunity.com/dist/ez_setup.py python ez_setup.py
安装完setuptools后,再次源码安装就好了。