Mac version of the multi-pip coexist
From the official explanation, a pip python package management tool that provides a python package to find, download, install, uninstall capabilities
python relies on third-party toolkit majority pip to install, such as Robot Framework, DB connect, Requests and so on.
python3.x + pip above version comes with a default tool.
A. Mac os comes with python is
installed by default python2.7
View python version:
Louie-mac: ~ louiezhou $ python2 -V
Python 2.7.11rc1
Note: This uses python2 because of python2.x and python3.x install two versions coexist
View python installation location:
Louie-mac: ~ $ louiezhou Which python2
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
Under that Python2.7 how to install pip it?
$ Sudo easy_install pip # using the command line can be easily installed
View pip install version:
Louie-mac: ~ louiezhou $ PIP2 -V
pip 19.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip (Python 2.7)
查看pip下具体安装的工具包:
louie-mac:~ louiezhou$ pip2 list
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.
Package Version
-------------------------------------- ---------
altgraph 0.10.2
aniso8601 1.0.0
apipkg 1.4
Appium-Python-Client 0.21
asn1crypto 0.24.0
attrs 17.4.0
Automat 0.6.0
......
Two. Python3 and PIP3
pip is no need to install in python3 comes in, which is installed python3 there will pip kit, let's try it
python3 installation package official website https://www.python.org/downloads/release/python-371/
I am a Mac os choice is macOS 64-bit installer, you can install after downloading
And then look at the installation is complete python3 version:
Louie-mac: ~ louiezhou $ python3 -V
Python 3.3.5
View installation path:
Louie-mac: ~ $ louiezhou Which python3
/Library/Frameworks/Python.framework/Versions/3.3/bin/python3
View pip3 version:
Louie-mac: ~ louiezhou $ pip3 -V
PIP 19.0.3 from /usr/local/lib/python3.7/site-packages/pip (Python 3.7)
See installation path PIP3:
Louie-MAC: $ ~ louiezhou Which PIP3
/ usr / local / bin / PIP3
You will find pip2 and pip3 versions and have been completely different path
Under normal circumstances Tip: python2 command not found, the recommended route will be added to the PATH:
#python the Set
# Setting PATH for Python 2.7
# at The Original Version IS saved in .bash_profile.pysave
Export PATH = "/ Library / Frameworks / Python.framework /Versions/2.7/bin:${PATH} "
# Setting PATH for Python 3.3
# The original version is saved in .bash_profile.pysave
export PATH="/Library/Frameworks/Python.framework/Versions/3.3/bin:${PATH}"
With pip3 you try to install a kit:
Louie-mac: Site-Packages Standard Package louiezhou $ pip3 install pymysql
Collecting pymysql
Downloading https://files.pythonhosted.org/packages/ed/39/15045ae46f2a123019aa968dfcba0396c161c20f855f11dea6796bcaae95/PyMySQL-0.9.3-py2 any.whl-none-.py3 (47kB)
100% | ████████████████████████████████ | 51kB 418Kb / S
the Installing Collected Packages: pymysql
Successfully Installed pymysql-0.9.3
To see if the installation was successful:
Louie-mac: Site-Packages Standard Package louiezhou $ PIP3 List
Package Penalty for Version
---------- -------
numpy 1.16.4
PIP 19.0.3
PyMySQL 0.9.3
setuptools 40.8. 0
Wheel 0.33.1
导入包看是否会报错:
louie-mac:site-packages louiezhou$ python3
Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 01:12:57)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymysql
>>>
No error message.
Get help
pip --help
Upgrade PIP
PIP PIP install -U
If this upgrade command problems, you can use the following command:
sudo easy_install --upgrade PIP
Uninstall package
pip uninstall Django == 1.7
Check scalable package
pip list -o
Featured today recommended
JMeter test -if Interface Controller
Jmeter interface test - regular expression
Jmeter interface testing - parametric
Consultation plus micro letter
Scan QR code
Welcome to introduce ourselves and recommendations, micro-channel needs to push your resume!
Please Mengchuo two-dimensional code below to learn more