Introduction
Sometimes you may need to use pip package manager inside python eg. when some imports may raise ImportError
and you want to handle the exception. If you unpack on Windows Python_root/Scripts/pip.exe
inside is stored __main__.py
file, where main
class from pip
package is imported. This means pip package is used whenever you use pip executable. For usage of pip as executable see: pip: PyPI Package Manager
Syntax
- pip.<function|attribute|class> where function is one of:
- autocomplete()
- Command and option completion for the main option parser (and options) and its subcommands (and options). Enable by sourcing one of the completion shell scripts (bash, zsh or fish).
- check_isolated(args)
- param args {list}
- returns {boolean}
- create_main_parser()
- returns {pip.baseparser.ConfigOptionParser object}
- main(args=None)
- param args {list}
- returns {integer} If not failed than returns 0
- parseopts(args)
- get_installed_distributions()
- get_similar_commands(name)
- Command name auto-correct.
- param name {string}
- returns {boolean}
- get_summaries(ordered=True)
- Yields sorted (command name, command summary) tuples.
- get_prog()
- dist_is_editable(dist)
- Is distribution an editable install?
- param dist {object}
- returns {boolean}
- commands_dict