Mac M1 安装pip2(python2.7)

1. 下载pip2脚本文件
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
2. 安装pip2脚本文件
python get-pip.py

执行命令后看到以下内容:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting pip<21.0
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 900 kB/s 
Installing collected packages: pip
  WARNING: The scripts pip, pip2 and pip2.7 are installed in '/Users/doublefs/Library/Python/2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.3.4
3. 创建软连接
sudo ln -s ~/Library/Python/2.7/bin/pip /usr/local/bin/pip
4. 最后测试
pip -V

你可能感兴趣的:(Mac M1 安装pip2(python2.7))