I was curious about ** pip ** used when installing modules and packages with python, so I summarized it.
Easy version control and upgrades. It is quite convenient if you know how to add it.
table of contents
Abbreviation for Pip javax Packages (or Python). How to read is pip.
You can install and uninstall packages officially registered in python.
**
It is pip to access PyPI with a command and install files.
Of modules and packages
--Installation
Such
The case is a description when the path passes.
4-1. Normal installation 4-2. Upgrade 4-3. Install by specifying the version (can be downgraded)
If it is already installed, "Requirement already satisfied:" is displayed.
The option can be either "-U" or "--update".
If it is already the latest, "Requirement already up-to-date:" is displayed.
You can also install (downgrade) the old version.
** ▼ Check all together ** 5-1. pip list 5-2. pip freeze 5-3. Check only those that are not the latest version
** ▼ Check individually ** 5-4. Check the version of pip 5-5. Check the package version
pip list
> pip list
Package Version
-------------------- ----------
attrs 19.3.0
backcall 0.1.0
bleach 3.1.0
certifi 2019.11.28
chardet 3.0.4
Click 7.0
colorama 0.4.3
dash 1.9.0
dash-core-components 1.8.0
dash-html-components 1.0.2
・
・
・
5-2.pip freeze The basic function is the same as "pip list". The display format is different. freeze can specify the display method (likely)
> pip freeze
attrs==19.3.0
backcall==0.1.0
bleach==3.1.0
certifi==2019.11.28
chardet==3.0.4
Click==7.0
colorama==0.4.3
dash==1.9.0
dash-core-components==1.8.0
dash-html-components==1.0.2
・
・
・
pip list --outdate
Shows the package name, currently installed version, and latest version.
> pip list --outdate
Package Version Latest Type
-------------------- ------- ------ -----
bleach 3.1.0 3.1.3 wheel
Click 7.0 7.1.1 wheel
dash 1.9.0 1.9.1 sdist
dash-core-components 1.8.0 1.8.1 sdist
dash-table 4.6.0 4.6.1 sdist
decorator 4.4.1 4.4.2 wheel
idna 2.8 2.9 wheel
・
・
・
pip -V
└ "-V" is uppercase.
Show version and destination path.
> pip -V
pip 20.0.2 from c:\users\appdata\local\programs\python\lib\site-packages\pip (python 3.8)
You can see the version information, official URL, creator, save destination path, etc.
> pip show selenium
Name: selenium
Version: 3.141.0
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: c:\users\appdata\local\programs\python\lib\site-packages
Requires: urllib3
Required-by:
It can be used when you want to download the latest file without installing it.
> pip help
Usage:
pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
config Manage local and global configuration.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
debug Show information useful for debugging.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment
variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be used up
to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be used up
to 3 times (corresponding to WARNING, ERROR, and
CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should attempt
(default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch,
(i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host or host:port pair as trusted, even though
it does not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file containing
the private key and the certificate in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine whether a new
version of pip is available for download. Implied with
--no-index.
--no-color Suppress colored output
--no-python-version-warning
Silence deprecation warnings for upcoming unsupported
Pythons.
You can check the usage and options of each command.
> pip install -h
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
Description:
Install packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
pip also supports installing from "requirements files", which provide
an easy way to specify a whole environment to be installed.
Install Options:
-r, --requirement <file> Install from the given requirements file. This option
・
・
・
In pip, pip commands such as "pip2" and "pip3" are prepared for each version of python.
Recommended Posts