欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

-bash: pip: command not found

程序员文章站 2022-07-12 13:41:43
...
[[email protected] ~]# curl -O https://bootstrap.pypa.io/get-pip.py
[[email protected] ~]# python get-pip.py

---- or ----

  1. 先安装setuptools
    将下载后的tar文件解压,用CMD模式进入到解压后的文件所在的目录执行命令:
    下载地址:https://pypi.python.org/pypi/setuptools#downloads
 python setup.py install
  • 如果报错
  File "/usr/local/src/setuptools-39.0.1/setuptools/command/bdist_egg.py", line 234, in run
    dry_run=self.dry_run, mode=self.gen_header())
  File "/usr/local/src/setuptools-39.0.1/setuptools/command/bdist_egg.py", line 495, in make_zipfile
    z = zipfile.ZipFile(zip_filename, mode, compression=compression)
  File "/usr/local/lib/python2.7/zipfile.py", line 736, in __init__
    "Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module

则需要先安装 yum -y install zlib zlib-devel
在编译安装 python 后,才能安装 setuptools

  1. 安装pip
     下载地址:https://pypi.python.org/pypi/pip#downloads
    将下载后的tar文件解压,用CMD模式进入到解压后的文件所在的目录执行命
python setup.py install 
  1. 安装完成