centos6 python2 安装pip的一次记录

服务器上需要 kazoo 包监控 zookeeper 上的节点。

打算使用 yum 来安装,首先安装 epel 包:

1、yum -y install epel-release

通过 yum 安装 pip.

2、yum -y install python-pip.

安装完毕之后,运行 pip 提示:

pkg_resources.DistributionNotFound: The 'pip==7.1.0' distribution was not found and is required by the application.

卸载 pip,使用源码安装。

3、yum remove python-pip

去这里下载:https://pypi.org/project/pip/#files

wget https://files.pythonhosted.org/packages/00/9e/4c83a0950d8bdec0b4ca72afd2f9cea92d08eb7c1a768363f2ea458d08b4/pip-19.2.3.tar.gz

4、解压之后,进去目录执行 python setup.py install 安装。

5、如果步骤 4 安装 pip 的时候,报错 ImportError: No module named setuptools,则首先去下载:https://pypi.org/project/setuptools/

wget https://files.pythonhosted.org/packages/d9/ca/7279974e489e8b65003fe618a1a741d6350227fa2bf48d16be76c7422423/setuptools-41.2.0.zip.

加压之后,进到目录里执行 python setup.py install 安装 setuptools。待 setuptools 安装完毕,再回到步骤 4 去安装 pip.

Guess you like

Origin blog.csdn.net/zhouguoqionghai/article/details/100144785