-
pip
pip
is a package manager for Python packages, or modules if you like .From PyPA, pip is already installed if you are using Python 2>2.7.9 or Python 3>3.4 downloaded from python.org or if you are working in a Vitual Environment created by virtualenv or pyvenv.
A
package
contains all the files you need for a module.Modules
are Python code libraries you can include in your project. -
pip3
From [Do we need pip] and [pip3]?,
There is no program called pip3.
pip3
is just a synonym ofpip
, 就像某个软件(比如typora)针对win10和win8的区别。pip is a Python package that can be executed as
pythonN.M -m pip
这种方式是最好的
pip
执行方案,不用解决pip
版本,版本在pythonN.M
中指明了。 -
soft link
ls -l `which pip` ls -l `which pip3`
-
作用机理
When you issue a command like
pip install package
:- it checks an online repository and downloads the package(which may contain multiple modules)
- then puts the modules in a designated place
- updates a local index to record where they can be found
-
必知必会
all commands could be find Reference Guide.
-
pip install -r requirements.txt
“Requirements files” are files containing a list of items to be installed using pip install .
Logically, a Requirements file is just a list of pip install argument placed in a file.
Requirement files are used to hold the result from
pip freeze
for the purpose of archieving repeatable installations.pip freeze > requirements.txt
-
pip install package.whl
pip prefers wheels where they are available.
to build wheels for your requirements through pip wheel, you need wheel library.
-
pip uninstall package
-
pip list
pip list --outdated
-
pip show package
-
pip search "package"
search PyPI for packages
-
-
总结
pythonN.M -m pip
是最佳时间方案。 -
References
再次认识pip与pip3 in Python
最新推荐文章于 2023-12-05 11:15:57 发布