1使用root权限用户

2执行easy_install-2.7 pip    

1 [root@MacBook-Air ~]#easy_install-2.7 pip
   Searching for pip
 2 Reading https://pypi.python.org/simple/pip/
 3 Best match: pip 19.2.2
 4 Downloading https://files.pythonhosted.org/packages/aa/1a/62fb0b95b1572c76dbc3cc31124a8b6866cbe9139eb7659ac7349457cf7c/pip-19.2.2.tar.gz#sha256=e05103825871e210d50a44c7e448587b0ed99dd775d3ef586304c58f40224a53
 5 Processing pip-19.2.2.tar.gz
 6 Writing /tmp/easy_install-EZDKIa/pip-19.2.2/setup.cfg
 7 Running pip-19.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-EZDKIa/pip-19.2.2/egg-dist-tmp-YniXB1
 8 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
 9   warnings.warn(msg)
10 warning: no files found matching 'docs/docutils.conf'
11 warning: no previously-included files found matching '.coveragerc'
12 warning: no previously-included files found matching '.mailmap'
13 warning: no previously-included files found matching '.appveyor.yml'
14 warning: no previously-included files found matching '.travis.yml'
15 warning: no previously-included files found matching 'tox.ini'
16 warning: no files found matching 'Makefile' under directory 'docs'
17 warning: no files found matching '*.bat' under directory 'docs'
18 warning: no previously-included files found matching 'src/pip/_vendor/six'
19 warning: no previously-included files found matching 'src/pip/_vendor/six/moves'
20 warning: no previously-included files matching '*.pyi' found under directory 'src/pip/_vendor'
21 no previously-included directories found matching '.github'
22 no previously-included directories found matching '.azure-pipelines'
23 no previously-included directories found matching 'docs/build'
24 no previously-included directories found matching 'news'
25 no previously-included directories found matching 'tasks'
26 no previously-included directories found matching 'tests'
27 no previously-included directories found matching 'tools'
28 creating /Library/Python/2.7/site-packages/pip-19.2.2-py2.7.egg
29 Extracting pip-19.2.2-py2.7.egg to /Library/Python/2.7/site-packages
30 Adding pip 19.2.2 to easy-install.pth file
31 Installing pip script to /usr/local/bin
32 Installing pip2.7 script to /usr/local/bin
33 Installing pip2 script to /usr/local/bin
34 
35 Installed /Library/Python/2.7/site-packages/pip-19.2.2-py2.7.egg
36 Processing dependencies for pip
37 Finished processing dependencies for pip
38 [root@MacBook-Air ~]#which pip
39 /usr/local/bin/pip

 

3安装pymysql

1 [root@MacBook-Air ~]#pip install pymysql
2 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
3 Collecting pymysql
4   Downloading https://files.pythonhosted.org/packages/ed/39/15045ae46f2a123019aa968dfcba0396c161c20f855f11dea6796bcaae95/PyMySQL-0.9.3-py2.py3-none-any.whl (47kB)
5      |████████████████████████████████| 51kB 40kB/s
6 Installing collected packages: pymysql
7 Successfully installed pymysql-0.9.3