foreword
There is no need to install python under ubuntu16.04. It is already installed by default. You can use it to whereis python
view the path where python is located. The default is version 2.7. There are pip
two pip2
commands 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 ubuntupip
, 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