]>
crepu.dev Git - config.git/blob - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/pip/__main__.py
5 # Remove '' and current working directory from the first entry
6 # of sys.path, if present to avoid using current directory
7 # in pip commands check, freeze, install, list and show,
8 # when invoked as python -m pip <command>
9 if sys
.path
[0] in ("", os
.getcwd()):
12 # If we are running from a wheel, add the wheel to sys.path
13 # This allows the usage python pip-*.whl/pip install pip-*.whl
15 # __file__ is pip-*.whl/pip/__main__.py
16 # first dirname call strips of '/__main__.py', second strips off '/pip'
17 # Resulting path is the name of the wheel itself
18 # Add that to sys.path so we can import pip
19 path
= os
.path
.dirname(os
.path
.dirname(__file__
))
20 sys
.path
.insert(0, path
)
22 if __name__
== "__main__":
23 # Work around the error reported in #9540, pending a proper fix.
24 # Note: It is essential the warning filter is set *before* importing
25 # pip, as the deprecation happens at import time, not runtime.
26 warnings
.filterwarnings(
27 "ignore", category
=DeprecationWarning, module
=".*packaging\\.version"
29 from pip
._internal
.cli
.main
import main
as _main