Python之版本相争

在Ubuntu 20 版本的时候,不支持直接下载python2的pip ,所以,有下面的解决方法

  1. Start by enabling the universe repository:

    1
    sudo add-apt-repository universe
  2. Update the packages index and install Python 2:

    1
    2
    sudo apt update
    sudo apt install python2
  3. Use curl to download the get-pip.py script:

    1
    curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
  4. Once the repository is enabled, run the script as sudo user with python2 to install pip :

    1
    sudo python2 get-pip.py
  5. Verify the installation

    1
    pip2 --version