(Search) (../../search/) (Copyright) (../../copyright/) (pip uninstall) (../pip_uninstall/) (pip) (../pip/) pip install - pip documentation v24.3.dev0 (../../_static/pygments.css?v=a746c00c) (../../_static/styles/furo.css?v=354aac6f) (../../_static/copybutton.css?v=76b2166b) (../../_static/tabs.css?v=4c969af8) (/_/static/css/badge_only.css) (../../_static/styles/furo-extensions.css?v=302659d7) (/_/static/css/readthedocs-doc-embed.css) Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Hide navigation sidebar Hide table of contents sidebar Skip to content Toggle site navigation sidebar (../../) pip documentation v24.3.dev0 Toggle Light / Dark / Auto color theme Toggle table of contents sidebar (../../) pip documentation v24.3.dev0 (Search) (yes) (default) (../../getting-started/) Getting Started (../../installation/) Installation (../../user_guide/) User Guide (../../topics/) Topic Guides Toggle navigation of Topic Guides (../../topics/authentication/) Authentication (../../topics/caching/) Caching (../../topics/configuration/) Configuration (../../topics/dependency-resolution/) Dependency Resolution (../../topics/more-dependency-resolution/) More on Dependency Resolution (../../topics/https-certificates/) HTTPS Certificates (../../topics/local-project-installs/) Local project installs (../../topics/repeatable-installs/) Repeatable Installs (../../topics/secure-installs/) Secure installs (../../topics/vcs-support/) VCS Support (../../topics/python-option/) Managing a different Python interpreter (../../topics/workflow/) Pip is not a workflow management tool (../../reference/) Reference Toggle navigation of Reference (../../reference/build-system/) Build System Interface Toggle navigation of Build System Interface (../../reference/build-system/pyproject-toml/) pyproject.toml (../../reference/build-system/setup-py/) setup.py (legacy) (../../reference/requirement-specifiers/) Requirement Specifiers (../../reference/requirements-file-format/) Requirements File Format (../../reference/installation-report/) Installation Report (../../reference/inspect-report/) pip inspect JSON output specification (../) Commands Toggle navigation of Commands (../pip/) pip pip install (../pip_uninstall/) pip uninstall (../pip_inspect/) pip inspect (../pip_list/) pip list (../pip_show/) pip show (../pip_freeze/) pip freeze (../pip_check/) pip check (../pip_download/) pip download (../pip_wheel/) pip wheel (../pip_hash/) pip hash (../pip_search/) pip search (../pip_cache/) pip cache (../pip_config/) pip config (../pip_debug/) pip debug Project (../../development/) Development Toggle navigation of Development (../../development/getting-started/) Getting Started (../../development/contributing/) Contributing (../../development/ci/) Continuous Integration (../../development/issue-triage/) Issue Triage (../../development/architecture/) Architecture of pip’s internals Toggle navigation of Architecture of pip’s internals (../../development/architecture/overview/) Broad functionality overview (../../development/architecture/anatomy/) Repository anatomy & directory structure (../../development/architecture/configuration-files/) Configuration File Handling (../../development/architecture/package-finding/) Finding and choosing files (index and PackageFinder ) (../../development/architecture/command-line-interface/) Command Line Interface (../../development/architecture/upgrade-options/) Options that control the installation process (../../development/release-process/) Release process (../../development/vendoring-policy/) Vendoring Policy (../../ux-research-design/) UX Research & Design Toggle navigation of UX Research & Design (../../ux-research-design/contribute/) How to Contribute (../../ux-research-design/guidance/) UX Guidance (../../ux-research-design/research-results/) UX Research Results Toggle navigation of UX Research Results (../../ux-research-design/research-results/about-our-users/) About pip’s Users (../../ux-research-design/research-results/mental-models/) How Users Understand pip (../../ux-research-design/research-results/users-and-security/) How pip users think about security (../../ux-research-design/research-results/ci-cd/) How pip is used in interactive environments (i.e. CI, CD) (../../ux-research-design/research-results/personas/) pip Personas (../../ux-research-design/research-results/prioritizing-features/) Prioritizing pip Features (../../ux-research-design/research-results/override-conflicting-dependencies/) Providing an override to install packages with conflicting dependencies (../../ux-research-design/research-results/pip-force-reinstall/) pip --force-reinstall (../../ux-research-design/research-results/pip-search/) pip search (../../ux-research-design/research-results/pip-upgrade-conflict/) pip Upgrade Conflict (../../ux-research-design/research-results/improving-pips-documentation/) Improving pip’s Documentation (../../news/) Changelog (https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md) Code of Conduct (https://github.com/pypa/pip) GitHub v: latest v: latest Versions (https://pip.pypa.io/en/latest/cli/pip_install/) latest (https://pip.pypa.io/en/stable/cli/pip_install/) stable On Read the Docs (//readthedocs.org/projects/pip/) Project Home (//readthedocs.org/projects/pip/builds/) Builds (//readthedocs.org/projects/pip/downloads/) Downloads On GitHub (https://github.com/pypa/pip/blob/main/docs/html/cli/pip_install.rst) View (https://github.com/pypa/pip/edit/main/docs/html/cli/pip_install.rst) Edit Search (Search docs) Hosted by (https://readthedocs.org) Read the Docs · (https://docs.readthedocs.io/page/privacy-policy.html) Privacy Policy Back to top (../../_sources/cli/pip_install.rst.txt) (View this page) View this page (https://github.com/pypa/pip/edit/main/docs/html/cli/pip_install.rst) (Edit this page) Edit this page Toggle Light / Dark / Auto color theme Toggle table of contents sidebar pip install(Link to this heading) ¶ Usage(Link to this heading) ¶ Unix/macOS python - m pip install [ options ] < requirement specifier > [ package - index - options ] ... python - m pip install [ options ] - r < requirements file > [ package - index - options ] ... python - m pip install [ options ] [ - e ] < vcs project url > ... python - m pip install [ options ] [ - e ] < local project path > ... python - m pip install [ options ] < archive url / path > ... Copy to clipboard Windows py - m pip install [ options ] < requirement specifier > [ package - index - options ] ... py - m pip install [ options ] - r < requirements file > [ package - index - options ] ... py - m pip install [ options ] [ - e ] < vcs project url > ... py - m pip install [ options ] [ - e ] < local project path > ... py - m pip install [ options ] < archive url / path > ... Copy to clipboard Description(Link to this heading) ¶ 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. Overview(Link to this heading) ¶ pip install has several stages: Identify the base requirements. The user supplied arguments are processed here. Resolve dependencies. What will be installed is determined here. Build wheels. All the dependencies that can be are built into wheels. Install the packages (and uninstall anything being upgraded/replaced). Note that pip install prefers to leave the installed version as-is unless --upgrade is specified. Argument Handling(Link to this heading) ¶ When looking at the items to be installed, pip checks what type of item each is, in the following order: Project or archive URL. Local directory (which must contain a pyproject.toml or setup.py , otherwise pip will report an error). Local file (a sdist or wheel format archive, following the naming conventions for those formats). A (https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers) ((in Python Packaging User Guide)) version specifier . Each item identified is added to the set of requirements to be satisfied by the install. Working Out the Name and Version(Link to this heading) ¶ For each candidate item, pip needs to know the project name and version. For wheels (identified by the .whl file extension) this can be obtained from the filename, as per the Wheel spec. For local directories, or explicitly specified sdist files, the setup.py egg_info command is used to determine the project metadata. For sdists located via an index, the filename is parsed for the name and project version (this is in theory slightly less reliable than using the egg_info command, but avoids downloading and processing unnecessary numbers of files). Any URL may use the #egg=name syntax (see (../../topics/vcs-support/) VCS Support ) to explicitly state the project name. Satisfying Requirements(Link to this heading) ¶ Once pip has the set of requirements to satisfy, it chooses which version of each requirement to install using the simple rule that the latest version that satisfies the given constraints will be installed (but see here for an exception regarding pre-release versions). Where more than one source of the chosen version is available, it is assumed that any source is acceptable (as otherwise the versions would differ). Obtaining information about what was installed(Link to this heading) ¶ The install command has a --report option that will generate a JSON report of what pip has installed. In combination with the --dry-run and --ignore-installed it can be used to resolve a set of requirements without actually installing them. The report can be written to a file, or to standard output (using --report - in combination with --quiet ). The format of the JSON report is described in (../../reference/installation-report/) Installation Report . Installation Order(Link to this heading) ¶ Note This section is only about installation order of runtime dependencies, and does not apply to build dependencies (those are specified using the (https://packaging.python.org/en/latest/specifications/pyproject-toml/#pyproject-build-system-table) ((in Python Packaging User Guide)) [build-system] table ). As of v6.1.0, pip installs dependencies before their dependents, i.e. in “topological order.” This is the only commitment pip currently makes related to order. While it may be coincidentally true that pip will install things in the order of the install arguments or in the order of the items in a requirements file, this is not a promise. In the event of a dependency cycle (aka “circular dependency”), the current implementation (which might possibly change later) has it such that the first encountered member of the cycle is installed last. For instance, if quux depends on foo which depends on bar which depends on baz, which depends on foo: Unix/macOS $ python -m pip install quux ... Installing collected packages baz, bar, foo, quux $ python -m pip install bar ... Installing collected packages foo, baz, bar Copy to clipboard Windows C:\> py -m pip install quux ... Installing collected packages baz, bar, foo, quux C:\> py -m pip install bar ... Installing collected packages foo, baz, bar Copy to clipboard Prior to v6.1.0, pip made no commitments about install order. The decision to install topologically is based on the principle that installations should proceed in a way that leaves the environment usable at each step. This has two main practical benefits: Concurrent use of the environment during the install is more likely to work. A failed install is less likely to leave a broken environment. Although pip would like to support failure rollbacks eventually, in the mean time, this is an improvement. Although the new install order is not intended to replace (and does not replace) the use of setup_requires to declare build dependencies, it may help certain projects install from sdist (that might previously fail) that fit the following profile: They have build dependencies that are also declared as install dependencies using install_requires . python setup.py egg_info works without their build dependencies being installed. For whatever reason, they don’t or won’t declare their build dependencies using setup_requires . Requirements File Format This section has been moved to (../../reference/requirements-file-format/) Requirements File Format . Requirement Specifiers This section has been moved to (../../reference/requirement-specifiers/) Requirement Specifiers . Per-requirement Overrides This is now covered in (../../reference/requirements-file-format/) Requirements File Format . Pre-release Versions(Link to this heading) ¶ Starting with v1.4, pip will only install stable versions as specified by (https://www.python.org/dev/peps/pep-0440/#handling-of-pre-releases) pre-releases by default. If a version cannot be parsed as a (https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers) ((in Python Packaging User Guide)) compliant version then it is assumed to be a pre-release. If a Requirement specifier includes a pre-release or development version (e.g. >=0.0.dev0 ) then pip will allow pre-release and development versions for that requirement. This does not include the != flag. The pip install command also supports a --pre flag that enables installation of pre-releases and development releases. VCS Support This is now covered in (../../topics/vcs-support/) VCS Support . Finding Packages(Link to this heading) ¶ pip searches for packages on (https://pypi.org/) PyPI using the (https://pypi.org/simple/) HTTP simple interface , which is documented (https://packaging.python.org/specifications/simple-repository-api/) here and (https://www.python.org/dev/peps/pep-0503/) there . pip offers a number of package index options for modifying how packages are found. pip looks for packages in a number of places: on PyPI (or the index given as --index-url , if not disabled via --no-index ), in the local filesystem, and in any additional repositories specified via --find-links or --extra-index-url . There is no priority in the locations that are searched. Rather they are all checked, and the “best” match for the requirements (in terms of version number - see the (https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers) ((in Python Packaging User Guide)) specification for details) is selected. See the pip install Examples . SSL Certificate Verification This is now covered in (../../topics/https-certificates/) HTTPS Certificates . Caching This is now covered in (../../topics/caching/) Caching . Wheel Cache This is now covered in (../../topics/caching/) Caching . Hash checking mode This is now covered in (../../topics/secure-installs/) Secure installs . Local Project Installs This is now covered in (../../topics/local-project-installs/) Local project installs . Editable installs This is now covered in (../../topics/local-project-installs/) Local project installs . Build System Interface This is now covered in (../../reference/build-system/) Build System Interface . Options(Link to this heading) ¶ -r , --requirement (Link to this definition) ¶ Install from the given requirements file. This option can be used multiple times. (environment variable: PIP_REQUIREMENT ) -c , --constraint (Link to this definition) ¶ Constrain versions using the given constraints file. This option can be used multiple times. (environment variable: PIP_CONSTRAINT ) --no-deps (Link to this definition) ¶ Don’t install package dependencies. (environment variable: PIP_NO_DEPS , PIP_NO_DEPENDENCIES ) --pre (Link to this definition) ¶ Include pre-release and development versions. By default, pip only finds stable versions. (environment variable: PIP_PRE ) -e , --editable (Link to this definition) ¶ Install a project in editable mode (i.e. setuptools “develop mode”) from a local project path or a VCS url. (environment variable: PIP_EDITABLE ) --dry-run (Link to this definition) ¶ Don’t actually install anything, just print what would be. Can be used in combination with --ignore-installed to ‘resolve’ the requirements. (environment variable: PIP_DRY_RUN ) -t , --target (Link to this definition) ¶ Install packages into . By default this will not replace existing files/folders in . Use --upgrade to replace existing packages in with new versions. (environment variable: PIP_TARGET ) --platform (Link to this definition) ¶ Only use wheels compatible with . Defaults to the platform of the running system. Use this option multiple times to specify multiple platforms supported by the target interpreter. (environment variable: PIP_PLATFORM ) --python-version (Link to this definition) ¶ The Python interpreter version to use for wheel and “Requires-Python” compatibility checks. Defaults to a version derived from the running interpreter. The version can be specified using up to three dot-separated integers (e.g. “3” for 3.0.0, “3.7” for 3.7.0, or “3.7.3”). A major-minor version can also be given as a string without dots (e.g. “37” for 3.7.0). (environment variable: PIP_PYTHON_VERSION ) --implementation (Link to this definition) ¶ Only use wheels compatible with Python implementation , e.g. ‘pp’, ‘jy’, ‘cp’, or ‘ip’. If not specified, then the current interpreter implementation is used. Use ‘py’ to force implementation-agnostic wheels. (environment variable: PIP_IMPLEMENTATION ) --abi (Link to this definition) ¶ Only use wheels compatible with Python abi , e.g. ‘pypy_41’. If not specified, then the current interpreter abi tag is used. Use this option multiple times to specify multiple abis supported by the target interpreter. Generally you will need to specify --implementation, --platform, and --python-version when using this option. (environment variable: PIP_ABI ) --user (Link to this definition) ¶ Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%Python on Windows. (See the Python documentation for site.USER_BASE for full details.) (environment variable: PIP_USER ) --root (Link to this definition) ¶ Install everything relative to this alternate root directory. (environment variable: PIP_ROOT ) --prefix (Link to this definition) ¶ Installation prefix where lib, bin and other top-level folders are placed. Note that the resulting installation may contain scripts and other resources which reference the Python interpreter of pip, and not that of --prefix . See also the --python option if the intention is to install packages into another (possibly pip-free) environment. (environment variable: PIP_PREFIX ) --src (Link to this definition) ¶ Directory to check out editable projects into. The default in a virtualenv is “/src”. The default for global installs is “/src”. (environment variable: PIP_SRC , PIP_SOURCE , PIP_SOURCE_DIR , PIP_SOURCE_DIRECTORY ) -U , --upgrade (Link to this definition) ¶ Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used. (environment variable: PIP_UPGRADE ) --upgrade-strategy (Link to this definition) ¶ Determines how dependency upgrading should be handled [default: only-if-needed]. “eager” - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). “only-if-needed” - are upgraded only when they do not satisfy the requirements of the upgraded package(s). (environment variable: PIP_UPGRADE_STRATEGY ) --force-reinstall (Link to this definition) ¶ Reinstall all packages even if they are already up-to-date. (environment variable: PIP_FORCE_REINSTALL ) -I , --ignore-installed (Link to this definition) ¶ Ignore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed with a different package manager! (environment variable: PIP_IGNORE_INSTALLED ) --ignore-requires-python (Link to this definition) ¶ Ignore the Requires-Python information. (environment variable: PIP_IGNORE_REQUIRES_PYTHON ) --no-build-isolation (Link to this definition) ¶ Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used. (environment variable: PIP_NO_BUILD_ISOLATION ) --use-pep517 (Link to this definition) ¶ Use PEP 517 for building source distributions (use --no-use-pep517 to force legacy behaviour). (environment variable: PIP_USE_PEP517 ) --check-build-dependencies (Link to this definition) ¶ Check the build dependencies when PEP517 is used. (environment variable: PIP_CHECK_BUILD_DEPENDENCIES ) --break-system-packages (Link to this definition) ¶ Allow pip to modify an EXTERNALLY-MANAGED Python installation (environment variable: PIP_BREAK_SYSTEM_PACKAGES ) -C , --config-settings (Link to this definition) ¶ Configuration settings to be passed to the PEP 517 build backend. Settings take the form KEY=VALUE. Use multiple --config-settings options to pass multiple keys to the backend. (environment variable: PIP_CONFIG_SETTINGS ) --global-option (Link to this definition) ¶ Extra global options to be supplied to the setup.py call before the install or bdist_wheel command. (environment variable: PIP_GLOBAL_OPTION ) --compile (Link to this definition) ¶ Compile Python source files to bytecode (environment variable: PIP_COMPILE ) --no-compile (Link to this definition) ¶ Do not compile Python source files to bytecode (environment variable: PIP_NO_COMPILE ) --no-warn-script-location (Link to this definition) ¶ Do not warn when installing scripts outside PATH (environment variable: PIP_NO_WARN_SCRIPT_LOCATION ) --no-warn-conflicts (Link to this definition) ¶ Do not warn about broken dependencies (environment variable: PIP_NO_WARN_CONFLICTS ) --no-binary (Link to this definition) ¶ Do not use binary packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either “:all:” to disable all binary packages, “:none:” to empty the set (notice the colons), or one or more package names with commas between them (no colons). Note that some packages are tricky to compile and may fail to install when this option is used on them. (environment variable: PIP_NO_BINARY ) --only-binary (Link to this definition) ¶ Do not use source packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either “:all:” to disable all source packages, “:none:” to empty the set, or one or more package names with commas between them. Packages without binary distributions will fail to install when this option is used on them. (environment variable: PIP_ONLY_BINARY ) --prefer-binary (Link to this definition) ¶ Prefer binary packages over source packages, even if the source packages are newer. (environment variable: PIP_PREFER_BINARY ) --require-hashes (Link to this definition) ¶ Require a hash to check each requirement against, for repeatable installs. This option is implied when any package in a requirements file has a --hash option. (environment variable: PIP_REQUIRE_HASHES ) --progress-bar (Link to this definition) ¶ Specify whether the progress bar should be used [on, off, raw] (default: on) (environment variable: PIP_PROGRESS_BAR ) --root-user-action (Link to this definition) ¶ Action if pip is run as a root user [warn, ignore] (default: warn) (environment variable: PIP_ROOT_USER_ACTION ) --report (Link to this definition) ¶ Generate a JSON file describing what pip did to install the provided requirements. Can be used in combination with --dry-run and --ignore-installed to ‘resolve’ the requirements. When - is used as file name it writes to stdout. When writing to stdout, please combine with the --quiet option to avoid mixing pip logging output with JSON output. (environment variable: PIP_REPORT ) --no-clean (Link to this definition) ¶ Don’t clean up build directories. (environment variable: PIP_NO_CLEAN ) -i , --index-url (Link to this definition) ¶ Base URL of the Python Package Index (default (https://pypi.org/simple) https://pypi.org/simple ). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format. (environment variable: PIP_INDEX_URL , PIP_PYPI_URL ) --extra-index-url (Link to this definition) ¶ Extra URLs of package indexes to use in addition to --index-url. Should follow the same rules as --index-url. (environment variable: PIP_EXTRA_INDEX_URL ) --no-index (Link to this definition) ¶ Ignore package index (only looking at --find-links URLs instead). (environment variable: PIP_NO_INDEX ) -f , --find-links (Link to this definition) ¶ If a URL or path to an html file, then parse for links to archives such as sdist (.tar.gz) or wheel (.whl) files. If a local path or (file://) file:// URL that’s a directory, then look for archives in the directory listing. Links to VCS project URLs are not supported. (environment variable: PIP_FIND_LINKS ) Examples(Link to this heading) ¶ Install SomePackage and its dependencies from (https://pypi.org/) PyPI using (../../reference/requirement-specifiers/#requirement-specifiers) Requirement Specifiers Unix/macOS python -m pip install SomePackage # latest version python -m pip install 'SomePackage==1.0.4' # specific version python -m pip install 'SomePackage>=1.0.4' # minimum version Copy to clipboard Windows py -m pip install SomePackage # latest version py -m pip install "SomePackage==1.0.4" # specific version py -m pip install "SomePackage>=1.0.4" # minimum version Copy to clipboard Install a list of requirements specified in a file. See the (../../user_guide/#requirements-files) Requirements files . Unix/macOS python -m pip install -r requirements.txt Copy to clipboard Windows py -m pip install -r requirements.txt Copy to clipboard Upgrade an already installed SomePackage to the latest from PyPI. Unix/macOS python -m pip install --upgrade SomePackage Copy to clipboard Windows py -m pip install --upgrade SomePackage Copy to clipboard Note This will guarantee an update to SomePackage as it is a direct requirement, and possibly upgrade dependencies if their installed versions do not meet the minimum requirements of SomePackage . Any non-requisite updates of its dependencies (indirect requirements) will be affected by the --upgrade-strategy command. Install a local project in “editable” mode. See the section on (../../topics/local-project-installs/#editable-installs) Editable Installs . Unix/macOS python -m pip install -e . # project in current directory python -m pip install -e path/to/project # project in another directory Copy to clipboard Windows py -m pip install -e . # project in current directory py -m pip install -e path/to/project # project in another directory Copy to clipboard Install a project from VCS Unix/macOS python -m pip install 'SomeProject@git+https://git.repo/some_pkg.git@1.3.1' Copy to clipboard Windows py -m pip install "SomeProject@git+https://git.repo/some_pkg.git@1.3.1" Copy to clipboard Install a project from VCS in “editable” mode. See the sections on (../../topics/vcs-support/) VCS Support and (../../topics/local-project-installs/#editable-installs) Editable Installs . Unix/macOS python -m pip install -e 'git+https://git.repo/some_pkg.git#egg=SomePackage' # from git python -m pip install -e 'hg+https://hg.repo/some_pkg.git#egg=SomePackage' # from mercurial python -m pip install -e 'svn+svn://svn.repo/some_pkg/trunk/#egg=SomePackage' # from svn python -m pip install -e 'git+https://git.repo/some_pkg.git@feature#egg=SomePackage' # from 'feature' branch python -m pip install -e 'git+https://git.repo/some_repo.git#egg=subdir&subdirectory=subdir_path' # install a python package from a repo subdirectory Copy to clipboard Windows py -m pip install -e "git+https://git.repo/some_pkg.git#egg=SomePackage" # from git py -m pip install -e "hg+https://hg.repo/some_pkg.git#egg=SomePackage" # from mercurial py -m pip install -e "svn+svn://svn.repo/some_pkg/trunk/#egg=SomePackage" # from svn py -m pip install -e "git+https://git.repo/some_pkg.git@feature#egg=SomePackage" # from 'feature' branch py -m pip install -e "git+https://git.repo/some_repo.git#egg=subdir&subdirectory=subdir_path" # install a python package from a repo subdirectory Copy to clipboard Install a package with extras, i.e., optional dependencies ((https://packaging.python.org/en/latest/specifications/dependency-specifiers/#dependency-specifiers) ((in Python Packaging User Guide)) specification ). Unix/macOS python -m pip install 'SomePackage[PDF]' python -m pip install 'SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path' python -m pip install '.[PDF]' # project in current directory python -m pip install 'SomePackage[PDF]==3.0' python -m pip install 'SomePackage[PDF,EPUB]' # multiple extras Copy to clipboard Windows py -m pip install "SomePackage[PDF]" py -m pip install "SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path" py -m pip install ".[PDF]" # project in current directory py -m pip install "SomePackage[PDF]==3.0" py -m pip install "SomePackage[PDF,EPUB]" # multiple extras Copy to clipboard Install a particular source archive file. Unix/macOS python -m pip install './downloads/SomePackage-1.0.4.tar.gz' python -m pip install 'http://my.package.repo/SomePackage-1.0.4.zip' Copy to clipboard Windows py -m pip install "./downloads/SomePackage-1.0.4.tar.gz" py -m pip install "http://my.package.repo/SomePackage-1.0.4.zip" Copy to clipboard Install a particular source archive file following direct references ((https://packaging.python.org/en/latest/specifications/dependency-specifiers/#dependency-specifiers) ((in Python Packaging User Guide)) specification ). Unix/macOS python -m pip install 'SomeProject@http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl' python -m pip install 'SomeProject @ http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl' python -m pip install 'SomeProject@http://my.package.repo/1.2.3.tar.gz' Copy to clipboard Windows py -m pip install "SomeProject@http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl" py -m pip install "SomeProject @ http://my.package.repo/SomeProject-1.2.3-py33-none-any.whl" py -m pip install "SomeProject@http://my.package.repo/1.2.3.tar.gz" Copy to clipboard Install from alternative package repositories. Install from a different index, and not (https://pypi.org/) PyPI Unix/macOS python -m pip install --index-url http://my.package.repo/simple/ SomePackage Copy to clipboard Windows py -m pip install --index-url http://my.package.repo/simple/ SomePackage Copy to clipboard Install from a local flat directory containing archives (and don’t scan indexes): Unix/macOS python -m pip install --no-index --find-links= file:///local/dir/ SomePackage python -m pip install --no-index --find-links= /local/dir/ SomePackage python -m pip install --no-index --find-links= relative/dir/ SomePackage Copy to clipboard Windows py -m pip install --no-index --find-links= file:///local/dir/ SomePackage py -m pip install --no-index --find-links= /local/dir/ SomePackage py -m pip install --no-index --find-links= relative/dir/ SomePackage Copy to clipboard Search an additional index during install, in addition to (https://pypi.org/) PyPI Warning Using this option to search for packages which are not in the main repository (such as private packages) is unsafe, per a security vulnerability called (https://azure.microsoft.com/en-us/resources/3-ways-to-mitigate-risk-using-private-package-feeds/) dependency confusion : an attacker can claim the package on the public repository in a way that will ensure it gets chosen over the private package. Unix/macOS python -m pip install --extra-index-url http://my.package.repo/simple SomePackage Copy to clipboard Windows py -m pip install --extra-index-url http://my.package.repo/simple SomePackage Copy to clipboard Find pre-release and development versions, in addition to stable versions. By default, pip only finds stable versions. Unix/macOS python -m pip install --pre SomePackage Copy to clipboard Windows py -m pip install --pre SomePackage Copy to clipboard Install packages from source. Do not use any binary packages Unix/macOS python -m pip install SomePackage1 SomePackage2 --no-binary :all: Copy to clipboard Windows py -m pip install SomePackage1 SomePackage2 --no-binary :all: Copy to clipboard Specify SomePackage1 to be installed from source: Unix/macOS python -m pip install SomePackage1 SomePackage2 --no-binary SomePackage1 Copy to clipboard Windows py -m pip install SomePackage1 SomePackage2 --no-binary SomePackage1 Copy to clipboard (../pip_uninstall/) Next pip uninstall (../pip/) Previous pip (../../copyright/) Copyright © The pip developers Made with (https://www.sphinx-doc.org/) Sphinx and (https://pradyunsg.me) @pradyunsg 's (https://github.com/pradyunsg/furo) Furo (https://readthedocs.org/projects/pip) (https://github.com/pypa/pip) On this page pip install Usage Description Overview Argument Handling Working Out the Name and Version Satisfying Requirements Obtaining information about what was installed Installation Order Pre-release Versions Finding Packages Options Examples