Unable to use after pip upgrade

foreword

There is no need to install python under ubuntu16.04. It is already installed by default. You can use it to whereis pythonview the path where python is located. The default is version 2.7. There are piptwo pip2commands to install module tools at the same time. For other knowledge points, please refer to other blogs.

In some cases, Terminal will prompt You are using pip version 8.1.1, however version 10.0.1 is available.and You should consider upgrading via the 'pip install --upgrade pip' command.I was confused when I first started to play python under ubuntu, and prompted an error after the upgrade, so I can only usepip2

solution

  • use pip2
  • Change pip
    to copy the content directly under other people's ubuntu pip, it can be used normally, such as
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
  • check pip
    pip -V

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324753746&siteId=291194637