CINXE.COM

Installing Packages - Python Packaging User Guide

<!doctype html> <html class="no-js" lang="en" data-content_root="../../"> <head><meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1"/> <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="index" title="Index" href="../../genindex/" /><link rel="search" title="Search" href="../../search/" /><link rel="next" title="Managing Application Dependencies" href="../managing-dependencies/" /><link rel="prev" title="Tutorials" href="../" /> <link rel="shortcut icon" href="../../_static/py.png"/><!-- Generated with Sphinx 7.2.6 and Furo 2024.08.06 --> <title>Installing Packages - Python Packaging User Guide</title> <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=8f2a1f02" /> <link rel="stylesheet" type="text/css" href="../../_static/styles/furo.css?v=354aac6f" /> <link rel="stylesheet" type="text/css" href="../../_static/tabs.css?v=4c969af8" /> <link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="../../_static/styles/furo-extensions.css?v=302659d7" /> <style> body { --color-code-background: #f8f8f8; --color-code-foreground: black; } @media not print { body[data-theme="dark"] { --color-code-background: #202020; --color-code-foreground: #d0d0d0; } @media (prefers-color-scheme: dark) { body:not([data-theme="light"]) { --color-code-background: #202020; --color-code-foreground: #d0d0d0; } } } </style><script async type="text/javascript" src="/_/static/javascript/readthedocs-addons.js"></script><meta name="readthedocs-project-slug" content="python-packaging-user-guide" /><meta name="readthedocs-version-slug" content="latest" /><meta name="readthedocs-resolver-filename" content="/tutorials/installing-packages/" /><meta name="readthedocs-http-status" content="200" /></head> <body> <script> document.body.dataset.theme = localStorage.getItem("theme") || "auto"; </script> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <symbol id="svg-toc" viewBox="0 0 24 24"> <title>Contents</title> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024"> <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line> <line x1="3" y1="6" x2="21" y2="6"></line> <line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <symbol id="svg-sun" viewBox="0 0 24 24"> <title>Light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun"> <circle cx="12" cy="12" r="5"></circle> <line x1="12" y1="1" x2="12" y2="3"></line> <line x1="12" y1="21" x2="12" y2="23"></line> <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line> <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line> <line x1="1" y1="12" x2="3" y2="12"></line> <line x1="21" y1="12" x2="23" y2="12"></line> <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line> <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line> </svg> </symbol> <symbol id="svg-moon" viewBox="0 0 24 24"> <title>Dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" /> </svg> </symbol> <symbol id="svg-sun-with-moon" viewBox="0 0 24 24"> <title>Auto light/dark, in light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/> <line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/> <line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/> <line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/> <line x1="19" y1="14.05" x2="20.414" y2="15.464"/> <line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/> <line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/> <line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/> <line x1="19" y1="5.05" x2="20.414" y2="3.636"/> <circle cx="14.5" cy="9.55" r="3.6"/> </svg> </symbol> <symbol id="svg-moon-with-sun" viewBox="0 0 24 24"> <title>Auto light/dark, in dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/> <line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/> <line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/> <line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/> <line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/> <line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/> <line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/> <line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/> <line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/> <circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/> </svg> </symbol> <symbol id="svg-pencil" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code"> <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /> <path d="M13.5 6.5l4 4" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> <symbol id="svg-eye" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /> <path d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> </svg> <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation"> <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc"> <label class="overlay sidebar-overlay" for="__navigation"> <div class="visually-hidden">Hide navigation sidebar</div> </label> <label class="overlay toc-overlay" for="__toc"> <div class="visually-hidden">Hide table of contents sidebar</div> </label> <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a> <div class="page"> <header class="mobile-header"> <div class="header-left"> <label class="nav-overlay-icon" for="__navigation"> <div class="visually-hidden">Toggle site navigation sidebar</div> <i class="icon"><svg><use href="#svg-menu"></use></svg></i> </label> </div> <div class="header-center"> <a href="../../"><div class="brand">Python Packaging User Guide</div></a> </div> <div class="header-right"> <div class="theme-toggle-container theme-toggle-header"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-header-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> </header> <aside class="sidebar-drawer"> <div class="sidebar-container"> <div class="sidebar-sticky"><a class="sidebar-brand" href="../../"> <span class="sidebar-brand-text">Python Packaging User Guide</span> </a><form class="sidebar-search-container" method="get" action="../../search/" role="search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input type="hidden" name="check_keywords" value="yes"> <input type="hidden" name="area" value="default"> </form> <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree"> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../../overview/">Overview of Python Packaging</a></li> <li class="toctree-l1"><a class="reference internal" href="../../flow/">The Packaging Flow</a></li> <li class="toctree-l1 current has-children"><a class="reference internal" href="../">Tutorials</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Tutorials</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current"> <li class="toctree-l2 current current-page"><a class="current reference internal" href="#">Installing Packages</a></li> <li class="toctree-l2"><a class="reference internal" href="../managing-dependencies/">Managing Application Dependencies</a></li> <li class="toctree-l2"><a class="reference internal" href="../packaging-projects/">Packaging Python Projects</a></li> </ul> </li> <li class="toctree-l1 has-children"><a class="reference internal" href="../../guides/">Guides</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle navigation of Guides</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2 has-children"><a class="reference internal" href="../../guides/section-install/">Installation</a><input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><div class="visually-hidden">Toggle navigation of Installation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../../guides/installing-using-pip-and-virtual-environments/">Install packages in a virtual environment using pip and venv</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/installing-using-virtualenv/">Installing packages using virtualenv</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/installing-stand-alone-command-line-tools/">Installing stand alone command line tools</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/installing-using-linux-tools/">Installing pip/setuptools/wheel with Linux Package Managers</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/installing-scientific-packages/">Installing scientific packages</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../../guides/section-build-and-publish/">Building and Publishing</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><div class="visually-hidden">Toggle navigation of Building and Publishing</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../../guides/writing-pyproject-toml/">Writing your <code class="docutils literal notranslate"><span class="pre">pyproject.toml</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/distributing-packages-using-setuptools/">Packaging and distributing projects</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/dropping-older-python-versions/">Dropping support for older Python versions</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/packaging-binary-extensions/">Packaging binary extensions</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/packaging-namespace-packages/">Packaging namespace packages</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/creating-command-line-tools/">Creating and packaging command-line tools</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/creating-and-discovering-plugins/">Creating and discovering plugins</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/using-testpypi/">Using TestPyPI</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/making-a-pypi-friendly-readme/">Making a PyPI-friendly README</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/">Publishing package distribution releases using GitHub Actions CI/CD workflows</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/modernize-setup-py-project/">How to modernize a <code class="docutils literal notranslate"><span class="pre">setup.py</span></code> based project?</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/licensing-examples-and-user-scenarios/">Licensing examples and user scenarios</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../../guides/section-hosting/">Hosting</a><input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><div class="visually-hidden">Toggle navigation of Hosting</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../../guides/index-mirrors-and-caches/">Package index mirrors and caches</a></li> <li class="toctree-l3"><a class="reference internal" href="../../guides/hosting-your-own-index/">Hosting your own simple repository</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="../../guides/tool-recommendations/">Tool recommendations</a></li> <li class="toctree-l2"><a class="reference internal" href="../../guides/analyzing-pypi-package-downloads/">Analyzing PyPI package downloads</a></li> </ul> </li> <li class="toctree-l1 has-children"><a class="reference internal" href="../../discussions/">Discussions</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><div class="visually-hidden">Toggle navigation of Discussions</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="../../discussions/versioning/">Versioning</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/deploying-python-applications/">Deploying Python applications</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/pip-vs-easy-install/">pip vs easy_install</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/install-requires-vs-requirements/">install_requires vs requirements files</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/distribution-package-vs-import-package/">Distribution package vs. import package</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/package-formats/">Package Formats</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/src-layout-vs-flat-layout/">src layout vs flat layout</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/setup-py-deprecated/">Is <code class="docutils literal notranslate"><span class="pre">setup.py</span></code> deprecated?</a></li> <li class="toctree-l2"><a class="reference internal" href="../../discussions/single-source-version/">Single-sourcing the Project Version</a></li> </ul> </li> <li class="toctree-l1 has-children"><a class="reference internal" href="../../specifications/">PyPA specifications</a><input class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><div class="visually-hidden">Toggle navigation of PyPA specifications</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2 has-children"><a class="reference internal" href="../../specifications/section-distribution-metadata/">Package Distribution Metadata</a><input class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><div class="visually-hidden">Toggle navigation of Package Distribution Metadata</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../../specifications/name-normalization/">Names and normalization</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/core-metadata/">Core metadata specifications</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/version-specifiers/">Version specifiers</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/dependency-specifiers/">Dependency specifiers</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/pyproject-toml/"><code class="docutils literal notranslate"><span class="pre">pyproject.toml</span></code> specification</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/dependency-groups/">Dependency Groups</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/inline-script-metadata/">Inline script metadata</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/platform-compatibility-tags/">Platform compatibility tags</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/well-known-project-urls/">Well-known Project URLs in Metadata</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../../specifications/section-installation-metadata/">Package Installation Metadata</a><input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><div class="visually-hidden">Toggle navigation of Package Installation Metadata</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../../specifications/recording-installed-packages/">Recording installed projects</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/entry-points/">Entry points specification</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/direct-url/">Recording the Direct URL Origin of installed distributions</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/direct-url-data-structure/">Direct URL Data Structure</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/virtual-environments/">Python Virtual Environments</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/externally-managed-environments/">Externally Managed Environments</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../../specifications/section-distribution-formats/">Package Distribution File Formats</a><input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><div class="visually-hidden">Toggle navigation of Package Distribution File Formats</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../../specifications/source-distribution-format/">Source distribution format</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/binary-distribution-format/">Binary distribution format</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../../specifications/section-package-indices/">Package Index Interfaces</a><input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" role="switch" type="checkbox"/><label for="toctree-checkbox-11"><div class="visually-hidden">Toggle navigation of Package Index Interfaces</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../../specifications/pypirc/">The <code class="file docutils literal notranslate"><span class="pre">.pypirc</span></code> file</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/simple-repository-api/">Simple repository API</a></li> <li class="toctree-l3"><a class="reference internal" href="../../specifications/index-hosted-attestations/">Index hosted attestations</a></li> </ul> </li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../../key_projects/">Project Summaries</a></li> <li class="toctree-l1"><a class="reference internal" href="../../glossary/">Glossary</a></li> <li class="toctree-l1"><a class="reference internal" href="../../support/">How to Get Support</a></li> <li class="toctree-l1"><a class="reference internal" href="../../contribute/">Contribute to this guide</a></li> <li class="toctree-l1"><a class="reference internal" href="../../news/">News</a></li> </ul> </div> </div> </div> </div> </aside> <div class="main"> <div class="content"> <div class="article-container"> <a href="#" class="back-to-top muted-link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path> </svg> <span>Back to top</span> </a> <div class="content-icon-container"> <div class="view-this-page"> <a class="muted-link" href="https://github.com/pypa/packaging.python.org/blob/main/source/tutorials/installing-packages.rst?plain=true" title="View this page"> <svg><use href="#svg-eye"></use></svg> <span class="visually-hidden">View this page</span> </a> </div><div class="edit-this-page"> <a class="muted-link" href="https://github.com/pypa/packaging.python.org/edit/main/source/tutorials/installing-packages.rst" title="Edit this page"> <svg><use href="#svg-pencil"></use></svg> <span class="visually-hidden">Edit this page</span> </a> </div><div class="theme-toggle-container theme-toggle-content"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-content-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> <article role="main" id="furo-main-content"> <section id="installing-packages"> <span id="id1"></span><h1>Installing Packages<a class="headerlink" href="#installing-packages" title="Link to this heading">¶</a></h1> <p>This section covers the basics of how to install Python <a class="reference internal" href="../../glossary/#term-Distribution-Package"><span class="xref std std-term">packages</span></a>.</p> <p>It’s important to note that the term “package” in this context is being used to describe a bundle of software to be installed (i.e. as a synonym for a <a class="reference internal" href="../../glossary/#term-Distribution-Package"><span class="xref std std-term">distribution</span></a>). It does not refer to the kind of <a class="reference internal" href="../../glossary/#term-Import-Package"><span class="xref std std-term">package</span></a> that you import in your Python source code (i.e. a container of modules). It is common in the Python community to refer to a <a class="reference internal" href="../../glossary/#term-Distribution-Package"><span class="xref std std-term">distribution</span></a> using the term “package”. Using the term “distribution” is often not preferred, because it can easily be confused with a Linux distribution, or another larger software distribution like Python itself.</p> <section id="requirements-for-installing-packages"> <span id="installing-requirements"></span><h2>Requirements for Installing Packages<a class="headerlink" href="#requirements-for-installing-packages" title="Link to this heading">¶</a></h2> <p>This section describes the steps to follow before installing other Python packages.</p> <section id="ensure-you-can-run-python-from-the-command-line"> <h3>Ensure you can run Python from the command line<a class="headerlink" href="#ensure-you-can-run-python-from-the-command-line" title="Link to this heading">¶</a></h3> <p>Before you go any further, make sure you have Python and that the expected version is available from your command line. You can check this by running:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--0-input--1" name="tab-set--0" type="radio"><label class="tab-label" for="tab-set--0-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>--version </pre></div> </div> </div> <input class="tab-input" id="tab-set--0-input--2" name="tab-set--0" type="radio"><label class="tab-label" for="tab-set--0-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py --version </pre></div> </div> </div> </div> <p>You should get some output like <code class="docutils literal notranslate"><span class="pre">Python</span> <span class="pre">3.6.3</span></code>. If you do not have Python, please install the latest 3.x version from <a class="reference external" href="https://www.python.org">python.org</a> or refer to the <a class="reference external" href="https://docs.python-guide.org/starting/installation/#installation" title="(in pythonguide v0.0.1)"><span class="xref std std-ref">Installing Python</span></a> section of the Hitchhiker’s Guide to Python.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>If you’re a newcomer and you get an error like this:</p> <div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">python3</span> <span class="o">--</span><span class="n">version</span> <span class="gt">Traceback (most recent call last):</span> File <span class="nb">&quot;&lt;stdin&gt;&quot;</span>, line <span class="m">1</span>, in <span class="n">&lt;module&gt;</span> <span class="gr">NameError</span>: <span class="n">name &#39;python3&#39; is not defined</span> </pre></div> </div> <p>It’s because this command and other suggested commands in this tutorial are intended to be run in a <em>shell</em> (also called a <em>terminal</em> or <em>console</em>). See the Python for Beginners <a class="reference external" href="https://opentechschool.github.io/python-beginners/en/getting_started.html#what-is-python-exactly">getting started tutorial</a> for an introduction to using your operating system’s shell and interacting with Python.</p> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>If you’re using an enhanced shell like IPython or the Jupyter notebook, you can run system commands like those in this tutorial by prefacing them with a <code class="docutils literal notranslate"><span class="pre">!</span></code> character:</p> <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>In [1]: import sys !{sys.executable} --version Python 3.6.3 </pre></div> </div> <p>It’s recommended to write <code class="docutils literal notranslate"><span class="pre">{sys.executable}</span></code> rather than plain <code class="docutils literal notranslate"><span class="pre">python</span></code> in order to ensure that commands are run in the Python installation matching the currently running notebook (which may not be the same Python installation that the <code class="docutils literal notranslate"><span class="pre">python</span></code> command refers to).</p> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>Due to the way most Linux distributions are handling the Python 3 migration, Linux users using the system Python without creating a virtual environment first should replace the <code class="docutils literal notranslate"><span class="pre">python</span></code> command in this tutorial with <code class="docutils literal notranslate"><span class="pre">python3</span></code> and the <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">pip</span></code> command with <code class="docutils literal notranslate"><span class="pre">python3</span> <span class="pre">-m</span> <span class="pre">pip</span> <span class="pre">--user</span></code>. Do <em>not</em> run any of the commands in this tutorial with <code class="docutils literal notranslate"><span class="pre">sudo</span></code>: if you get a permissions error, come back to the section on creating virtual environments, set one up, and then continue with the tutorial as written.</p> </div> </section> <section id="ensure-you-can-run-pip-from-the-command-line"> <h3>Ensure you can run pip from the command line<a class="headerlink" href="#ensure-you-can-run-pip-from-the-command-line" title="Link to this heading">¶</a></h3> <p>Additionally, you’ll need to make sure you have <a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> available. You can check this by running:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--1-input--1" name="tab-set--1" type="radio"><label class="tab-label" for="tab-set--1-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>--version </pre></div> </div> </div> <input class="tab-input" id="tab-set--1-input--2" name="tab-set--1" type="radio"><label class="tab-label" for="tab-set--1-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip --version </pre></div> </div> </div> </div> <p>If you installed Python from source, with an installer from <a class="reference external" href="https://www.python.org">python.org</a>, or via <a class="reference external" href="https://brew.sh">Homebrew</a> you should already have pip. If you’re on Linux and installed using your OS package manager, you may have to install pip separately, see <a class="reference internal" href="../../guides/installing-using-linux-tools/"><span class="doc">Installing pip/setuptools/wheel with Linux Package Managers</span></a>.</p> <p>If <code class="docutils literal notranslate"><span class="pre">pip</span></code> isn’t already installed, then first try to bootstrap it from the standard library:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--2-input--1" name="tab-set--2" type="radio"><label class="tab-label" for="tab-set--2-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>ensurepip<span class="w"> </span>--default-pip </pre></div> </div> </div> <input class="tab-input" id="tab-set--2-input--2" name="tab-set--2" type="radio"><label class="tab-label" for="tab-set--2-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m ensurepip --default-pip </pre></div> </div> </div> </div> <p>If that still doesn’t allow you to run <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">pip</span></code>:</p> <ul> <li><p>Securely Download <a class="reference external" href="https://bootstrap.pypa.io/get-pip.py">get-pip.py</a> <a class="footnote-reference brackets" href="#id7" id="id2" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a></p></li> <li><p>Run <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">get-pip.py</span></code>. <a class="footnote-reference brackets" href="#id8" id="id3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> This will install or upgrade pip. Additionally, it will install <a class="reference internal" href="../../key_projects/#setuptools"><span class="std std-ref">Setuptools</span></a> and <a class="reference internal" href="../../key_projects/#wheel"><span class="std std-ref">wheel</span></a> if they’re not installed already.</p> <div class="admonition warning"> <p class="admonition-title">Warning</p> <p>Be cautious if you’re using a Python install that’s managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state. You can use <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">get-pip.py</span> <span class="pre">--prefix=/usr/local/</span></code> to install in <code class="docutils literal notranslate"><span class="pre">/usr/local</span></code> which is designed for locally-installed software.</p> </div> </li> </ul> </section> <section id="ensure-pip-setuptools-and-wheel-are-up-to-date"> <h3>Ensure pip, setuptools, and wheel are up to date<a class="headerlink" href="#ensure-pip-setuptools-and-wheel-are-up-to-date" title="Link to this heading">¶</a></h3> <p>While <code class="docutils literal notranslate"><span class="pre">pip</span></code> alone is sufficient to install from pre-built binary archives, up to date copies of the <code class="docutils literal notranslate"><span class="pre">setuptools</span></code> and <code class="docutils literal notranslate"><span class="pre">wheel</span></code> projects are useful to ensure you can also install from source archives:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--3-input--1" name="tab-set--3" type="radio"><label class="tab-label" for="tab-set--3-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--upgrade<span class="w"> </span>pip<span class="w"> </span>setuptools<span class="w"> </span>wheel </pre></div> </div> </div> <input class="tab-input" id="tab-set--3-input--2" name="tab-set--3" type="radio"><label class="tab-label" for="tab-set--3-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install --upgrade pip setuptools wheel </pre></div> </div> </div> </div> </section> <section id="optionally-create-a-virtual-environment"> <h3>Optionally, create a virtual environment<a class="headerlink" href="#optionally-create-a-virtual-environment" title="Link to this heading">¶</a></h3> <p>See <a class="reference internal" href="#creating-and-using-virtual-environments"><span class="std std-ref">section below</span></a> for details, but here’s the basic <a class="reference external" href="https://docs.python.org/3/library/venv.html" title="(in Python v3.13)"><span class="xref std std-doc">venv</span></a> <a class="footnote-reference brackets" href="#id9" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a> command to use on a typical Linux system:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--4-input--1" name="tab-set--4" type="radio"><label class="tab-label" for="tab-set--4-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>venv<span class="w"> </span>tutorial_env <span class="nb">source</span><span class="w"> </span>tutorial_env/bin/activate </pre></div> </div> </div> <input class="tab-input" id="tab-set--4-input--2" name="tab-set--4" type="radio"><label class="tab-label" for="tab-set--4-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m venv tutorial_env tutorial_env\Scripts\activate </pre></div> </div> </div> </div> <p>This will create a new virtual environment in the <code class="docutils literal notranslate"><span class="pre">tutorial_env</span></code> subdirectory, and configure the current shell to use it as the default <code class="docutils literal notranslate"><span class="pre">python</span></code> environment.</p> </section> </section> <section id="creating-virtual-environments"> <span id="creating-and-using-virtual-environments"></span><h2>Creating Virtual Environments<a class="headerlink" href="#creating-virtual-environments" title="Link to this heading">¶</a></h2> <p>Python “Virtual Environments” allow Python <a class="reference internal" href="../../glossary/#term-Distribution-Package"><span class="xref std std-term">packages</span></a> to be installed in an isolated location for a particular application, rather than being installed globally. If you are looking to safely install global command line tools, see <a class="reference internal" href="../../guides/installing-stand-alone-command-line-tools/"><span class="doc">Installing stand alone command line tools</span></a>.</p> <p>Imagine you have an application that needs version 1 of LibFoo, but another application requires version 2. How can you use both these applications? If you install everything into /usr/lib/python3.6/site-packages (or whatever your platform’s standard location is), it’s easy to end up in a situation where you unintentionally upgrade an application that shouldn’t be upgraded.</p> <p>Or more generally, what if you want to install an application and leave it be? If an application works, any change in its libraries or the versions of those libraries can break the application.</p> <p>Also, what if you can’t install <a class="reference internal" href="../../glossary/#term-Distribution-Package"><span class="xref std std-term">packages</span></a> into the global site-packages directory? For instance, on a shared host.</p> <p>In all these cases, virtual environments can help you. They have their own installation directories and they don’t share libraries with other virtual environments.</p> <p>Currently, there are two common tools for creating Python virtual environments:</p> <ul class="simple"> <li><p><a class="reference external" href="https://docs.python.org/3/library/venv.html" title="(in Python v3.13)"><span class="xref std std-doc">venv</span></a> is available by default in Python 3.3 and later, and installs <a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> into created virtual environments in Python 3.4 and later (Python versions prior to 3.12 also installed <a class="reference internal" href="../../key_projects/#setuptools"><span class="std std-ref">Setuptools</span></a>).</p></li> <li><p><a class="reference internal" href="../../key_projects/#virtualenv"><span class="std std-ref">virtualenv</span></a> needs to be installed separately, but supports Python 2.7+ and Python 3.3+, and <a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a>, <a class="reference internal" href="../../key_projects/#setuptools"><span class="std std-ref">Setuptools</span></a> and <a class="reference internal" href="../../key_projects/#wheel"><span class="std std-ref">wheel</span></a> are always installed into created virtual environments by default (regardless of Python version).</p></li> </ul> <p>The basic usage is like so:</p> <p>Using <a class="reference external" href="https://docs.python.org/3/library/venv.html" title="(in Python v3.13)"><span class="xref std std-doc">venv</span></a>:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--5-input--1" name="tab-set--5" type="radio"><label class="tab-label" for="tab-set--5-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>venv<span class="w"> </span>&lt;DIR&gt; <span class="nb">source</span><span class="w"> </span>&lt;DIR&gt;/bin/activate </pre></div> </div> </div> <input class="tab-input" id="tab-set--5-input--2" name="tab-set--5" type="radio"><label class="tab-label" for="tab-set--5-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m venv <span class="p">&lt;</span>DIR&gt; <span class="p">&lt;</span>DIR<span class="p">&gt;</span>\Scripts\activate </pre></div> </div> </div> </div> <p>Using <a class="reference internal" href="../../key_projects/#virtualenv"><span class="std std-ref">virtualenv</span></a>:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--6-input--1" name="tab-set--6" type="radio"><label class="tab-label" for="tab-set--6-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>virtualenv<span class="w"> </span>&lt;DIR&gt; <span class="nb">source</span><span class="w"> </span>&lt;DIR&gt;/bin/activate </pre></div> </div> </div> <input class="tab-input" id="tab-set--6-input--2" name="tab-set--6" type="radio"><label class="tab-label" for="tab-set--6-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>virtualenv <span class="p">&lt;</span>DIR&gt; <span class="p">&lt;</span>DIR<span class="p">&gt;</span>\Scripts\activate </pre></div> </div> </div> </div> <p>For more information, see the <a class="reference external" href="https://docs.python.org/3/library/venv.html" title="(in Python v3.13)"><span class="xref std std-doc">venv</span></a> docs or the <a class="reference external" href="https://virtualenv.pypa.io/en/stable/index.html" title="(in virtualenv v0.1)"><span class="xref std std-doc">virtualenv</span></a> docs.</p> <p>The use of <strong class="command">source</strong> under Unix shells ensures that the virtual environment’s variables are set within the current shell, and not in a subprocess (which then disappears, having no useful effect).</p> <p>In both of the above cases, Windows users should <em>not</em> use the <strong class="command">source</strong> command, but should rather run the <strong class="command">activate</strong> script directly from the command shell like so:</p> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span><span class="p">&lt;</span>DIR<span class="p">&gt;</span>\Scripts\activate </pre></div> </div> <p>Managing multiple virtual environments directly can become tedious, so the <a class="reference internal" href="../managing-dependencies/#managing-dependencies"><span class="std std-ref">dependency management tutorial</span></a> introduces a higher level tool, <a class="reference internal" href="../../key_projects/#pipenv"><span class="std std-ref">Pipenv</span></a>, that automatically manages a separate virtual environment for each project and application that you work on.</p> </section> <section id="use-pip-for-installing"> <h2>Use pip for Installing<a class="headerlink" href="#use-pip-for-installing" title="Link to this heading">¶</a></h2> <p><a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> is the recommended installer. Below, we’ll cover the most common usage scenarios. For more detail, see the <a class="reference external" href="https://pip.pypa.io/en/latest/" title="(in pip v25.1)"><span class="xref std std-doc">pip docs</span></a>, which includes a complete <a class="reference external" href="https://pip.pypa.io/en/latest/cli/" title="(in pip v25.1)"><span class="xref std std-doc">Reference Guide</span></a>.</p> </section> <section id="installing-from-pypi"> <h2>Installing from PyPI<a class="headerlink" href="#installing-from-pypi" title="Link to this heading">¶</a></h2> <p>The most common usage of <a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> is to install from the <a class="reference internal" href="../../glossary/#term-Python-Package-Index-PyPI"><span class="xref std std-term">Python Package Index</span></a> using a <a class="reference internal" href="../../glossary/#term-Requirement-Specifier"><span class="xref std std-term">requirement specifier</span></a>. Generally speaking, a requirement specifier is composed of a project name followed by an optional <a class="reference internal" href="../../glossary/#term-Version-Specifier"><span class="xref std std-term">version specifier</span></a>. A full description of the supported specifiers can be found in the <a class="reference internal" href="../../specifications/version-specifiers/#version-specifiers"><span class="std std-ref">Version specifier specification</span></a>. Below are some examples.</p> <p>To install the latest version of “SomeProject”:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--7-input--1" name="tab-set--7" type="radio"><label class="tab-label" for="tab-set--7-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span><span class="s2">&quot;SomeProject&quot;</span> </pre></div> </div> </div> <input class="tab-input" id="tab-set--7-input--2" name="tab-set--7" type="radio"><label class="tab-label" for="tab-set--7-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install <span class="s2">&quot;SomeProject&quot;</span> </pre></div> </div> </div> </div> <p>To install a specific version:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--8-input--1" name="tab-set--8" type="radio"><label class="tab-label" for="tab-set--8-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span><span class="s2">&quot;SomeProject==1.4&quot;</span> </pre></div> </div> </div> <input class="tab-input" id="tab-set--8-input--2" name="tab-set--8" type="radio"><label class="tab-label" for="tab-set--8-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install <span class="s2">&quot;SomeProject==1.4&quot;</span> </pre></div> </div> </div> </div> <p>To install greater than or equal to one version and less than another:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--9-input--1" name="tab-set--9" type="radio"><label class="tab-label" for="tab-set--9-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span><span class="s2">&quot;SomeProject&gt;=1,&lt;2&quot;</span> </pre></div> </div> </div> <input class="tab-input" id="tab-set--9-input--2" name="tab-set--9" type="radio"><label class="tab-label" for="tab-set--9-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install <span class="s2">&quot;SomeProject&gt;=1,&lt;2&quot;</span> </pre></div> </div> </div> </div> <p>To install a version that’s <a class="reference internal" href="../../specifications/version-specifiers/#version-specifiers-compatible-release"><span class="std std-ref">compatible</span></a> with a certain version: <a class="footnote-reference brackets" href="#id10" id="id5" role="doc-noteref"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a></p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--10-input--1" name="tab-set--10" type="radio"><label class="tab-label" for="tab-set--10-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span><span class="s2">&quot;SomeProject~=1.4.2&quot;</span> </pre></div> </div> </div> <input class="tab-input" id="tab-set--10-input--2" name="tab-set--10" type="radio"><label class="tab-label" for="tab-set--10-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install <span class="s2">&quot;SomeProject~=1.4.2&quot;</span> </pre></div> </div> </div> </div> <p>In this case, this means to install any version “==1.4.*” version that’s also “&gt;=1.4.2”.</p> </section> <section id="source-distributions-vs-wheels"> <h2>Source Distributions vs Wheels<a class="headerlink" href="#source-distributions-vs-wheels" title="Link to this heading">¶</a></h2> <p><a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> can install from either <a class="reference internal" href="../../glossary/#term-Source-Distribution-or-sdist"><span class="xref std std-term">Source Distributions (sdist)</span></a> or <a class="reference internal" href="../../glossary/#term-Wheel"><span class="xref std std-term">Wheels</span></a>, but if both are present on PyPI, pip will prefer a compatible <a class="reference internal" href="../../glossary/#term-Wheel"><span class="xref std std-term">wheel</span></a>. You can override pip`s default behavior by e.g. using its <a class="reference external" href="https://pip.pypa.io/en/latest/cli/pip_install/#install-no-binary" title="(in pip v25.1)"><span class="xref std std-ref">–no-binary</span></a> option.</p> <p><a class="reference internal" href="../../glossary/#term-Wheel"><span class="xref std std-term">Wheels</span></a> are a pre-built <a class="reference internal" href="../../glossary/#term-Distribution-Package"><span class="xref std std-term">distribution</span></a> format that provides faster installation compared to <a class="reference internal" href="../../glossary/#term-Source-Distribution-or-sdist"><span class="xref std std-term">Source Distributions (sdist)</span></a>, especially when a project contains compiled extensions.</p> <p>If <a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> does not find a wheel to install, it will locally build a wheel and cache it for future installs, instead of rebuilding the source distribution in the future.</p> </section> <section id="upgrading-packages"> <h2>Upgrading packages<a class="headerlink" href="#upgrading-packages" title="Link to this heading">¶</a></h2> <p>Upgrade an already installed <code class="docutils literal notranslate"><span class="pre">SomeProject</span></code> to the latest from PyPI.</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--11-input--1" name="tab-set--11" type="radio"><label class="tab-label" for="tab-set--11-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--upgrade<span class="w"> </span>SomeProject </pre></div> </div> </div> <input class="tab-input" id="tab-set--11-input--2" name="tab-set--11" type="radio"><label class="tab-label" for="tab-set--11-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install --upgrade SomeProject </pre></div> </div> </div> </div> </section> <section id="installing-to-the-user-site"> <span id="id6"></span><h2>Installing to the User Site<a class="headerlink" href="#installing-to-the-user-site" title="Link to this heading">¶</a></h2> <p>To install <a class="reference internal" href="../../glossary/#term-Distribution-Package"><span class="xref std std-term">packages</span></a> that are isolated to the current user, use the <code class="docutils literal notranslate"><span class="pre">--user</span></code> flag:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--12-input--1" name="tab-set--12" type="radio"><label class="tab-label" for="tab-set--12-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--user<span class="w"> </span>SomeProject </pre></div> </div> </div> <input class="tab-input" id="tab-set--12-input--2" name="tab-set--12" type="radio"><label class="tab-label" for="tab-set--12-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install --user SomeProject </pre></div> </div> </div> </div> <p>For more information see the <a class="reference external" href="https://pip.pypa.io/en/latest/user_guide/#user-installs">User Installs</a> section from the pip docs.</p> <p>Note that the <code class="docutils literal notranslate"><span class="pre">--user</span></code> flag has no effect when inside a virtual environment - all installation commands will affect the virtual environment.</p> <p>If <code class="docutils literal notranslate"><span class="pre">SomeProject</span></code> defines any command-line scripts or console entry points, <code class="docutils literal notranslate"><span class="pre">--user</span></code> will cause them to be installed inside the <a class="reference external" href="https://docs.python.org/3/library/site.html#site.USER_BASE">user base</a>’s binary directory, which may or may not already be present in your shell’s <span class="target" id="index-0"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code>. (Starting in version 10, pip displays a warning when installing any scripts to a directory outside <span class="target" id="index-1"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code>.) If the scripts are not available in your shell after installation, you’ll need to add the directory to your <span class="target" id="index-2"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code>:</p> <ul class="simple"> <li><p>On Linux and macOS you can find the user base binary directory by running <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">site</span> <span class="pre">--user-base</span></code> and adding <code class="docutils literal notranslate"><span class="pre">bin</span></code> to the end. For example, this will typically print <code class="docutils literal notranslate"><span class="pre">~/.local</span></code> (with <code class="docutils literal notranslate"><span class="pre">~</span></code> expanded to the absolute path to your home directory) so you’ll need to add <code class="docutils literal notranslate"><span class="pre">~/.local/bin</span></code> to your <code class="docutils literal notranslate"><span class="pre">PATH</span></code>. You can set your <code class="docutils literal notranslate"><span class="pre">PATH</span></code> permanently by <a class="reference external" href="https://stackoverflow.com/a/14638025">modifying ~/.profile</a>.</p></li> <li><p>On Windows you can find the user base binary directory by running <code class="docutils literal notranslate"><span class="pre">py</span> <span class="pre">-m</span> <span class="pre">site</span> <span class="pre">--user-site</span></code> and replacing <code class="docutils literal notranslate"><span class="pre">site-packages</span></code> with <code class="docutils literal notranslate"><span class="pre">Scripts</span></code>. For example, this could return <code class="docutils literal notranslate"><span class="pre">C:\Users\Username\AppData\Roaming\Python36\site-packages</span></code> so you would need to set your <code class="docutils literal notranslate"><span class="pre">PATH</span></code> to include <code class="docutils literal notranslate"><span class="pre">C:\Users\Username\AppData\Roaming\Python36\Scripts</span></code>. You can set your user <code class="docutils literal notranslate"><span class="pre">PATH</span></code> permanently in the <a class="reference external" href="https://docs.microsoft.com/en-us/windows/win32/shell/user-environment-variables?redirectedfrom=MSDN">Control Panel</a>. You may need to log out for the <code class="docutils literal notranslate"><span class="pre">PATH</span></code> changes to take effect.</p></li> </ul> </section> <section id="requirements-files"> <h2>Requirements files<a class="headerlink" href="#requirements-files" title="Link to this heading">¶</a></h2> <p>Install a list of requirements specified in a <a class="reference external" href="https://pip.pypa.io/en/latest/user_guide/#requirements-files" title="(in pip v25.1)"><span class="xref std std-ref">Requirements File</span></a>.</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--13-input--1" name="tab-set--13" type="radio"><label class="tab-label" for="tab-set--13-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-r<span class="w"> </span>requirements.txt </pre></div> </div> </div> <input class="tab-input" id="tab-set--13-input--2" name="tab-set--13" type="radio"><label class="tab-label" for="tab-set--13-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install -r requirements.txt </pre></div> </div> </div> </div> </section> <section id="installing-from-vcs"> <h2>Installing from VCS<a class="headerlink" href="#installing-from-vcs" title="Link to this heading">¶</a></h2> <p>Install a project from VCS in “editable” mode. For a full breakdown of the syntax, see pip’s section on <a class="reference external" href="https://pip.pypa.io/en/latest/topics/vcs-support/#vcs-support" title="(in pip v25.1)"><span class="xref std std-ref">VCS Support</span></a>.</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--14-input--1" name="tab-set--14" type="radio"><label class="tab-label" for="tab-set--14-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span>SomeProject<span class="w"> </span>@<span class="w"> </span>git+https://git.repo/some_pkg.git<span class="w"> </span><span class="c1"># from git</span> python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span>SomeProject<span class="w"> </span>@<span class="w"> </span>hg+https://hg.repo/some_pkg<span class="w"> </span><span class="c1"># from mercurial</span> python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span>SomeProject<span class="w"> </span>@<span class="w"> </span>svn+svn://svn.repo/some_pkg/trunk/<span class="w"> </span><span class="c1"># from svn</span> python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span>SomeProject<span class="w"> </span>@<span class="w"> </span>git+https://git.repo/some_pkg.git@feature<span class="w"> </span><span class="c1"># from a branch</span> </pre></div> </div> </div> <input class="tab-input" id="tab-set--14-input--2" name="tab-set--14" type="radio"><label class="tab-label" for="tab-set--14-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install -e SomeProject @ git+https://git.repo/some_pkg.git # from git py -m pip install -e SomeProject @ hg+https://hg.repo/some_pkg # from mercurial py -m pip install -e SomeProject @ svn+svn://svn.repo/some_pkg/trunk/ # from svn py -m pip install -e SomeProject @ git+https://git.repo/some_pkg.git@feature # from a branch </pre></div> </div> </div> </div> </section> <section id="installing-from-other-indexes"> <h2>Installing from other Indexes<a class="headerlink" href="#installing-from-other-indexes" title="Link to this heading">¶</a></h2> <p>Install from an alternate index</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--15-input--1" name="tab-set--15" type="radio"><label class="tab-label" for="tab-set--15-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--index-url<span class="w"> </span>http://my.package.repo/simple/<span class="w"> </span>SomeProject </pre></div> </div> </div> <input class="tab-input" id="tab-set--15-input--2" name="tab-set--15" type="radio"><label class="tab-label" for="tab-set--15-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install --index-url http://my.package.repo/simple/ SomeProject </pre></div> </div> </div> </div> <p>Search an additional index during install, in addition to <a class="reference internal" href="../../glossary/#term-Python-Package-Index-PyPI"><span class="xref std std-term">PyPI</span></a></p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--16-input--1" name="tab-set--16" type="radio"><label class="tab-label" for="tab-set--16-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--extra-index-url<span class="w"> </span>http://my.package.repo/simple<span class="w"> </span>SomeProject </pre></div> </div> </div> <input class="tab-input" id="tab-set--16-input--2" name="tab-set--16" type="radio"><label class="tab-label" for="tab-set--16-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install --extra-index-url http://my.package.repo/simple SomeProject </pre></div> </div> </div> </div> </section> <section id="installing-from-a-local-src-tree"> <h2>Installing from a local src tree<a class="headerlink" href="#installing-from-a-local-src-tree" title="Link to this heading">¶</a></h2> <p>Installing from local src in <a class="reference external" href="https://setuptools.pypa.io/en/latest/userguide/development_mode.html" title="(in setuptools v75.8.0.post20250203)"><span class="xref std std-doc">Development Mode</span></a>, i.e. in such a way that the project appears to be installed, but yet is still editable from the src tree.</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--17-input--1" name="tab-set--17" type="radio"><label class="tab-label" for="tab-set--17-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span>&lt;path&gt; </pre></div> </div> </div> <input class="tab-input" id="tab-set--17-input--2" name="tab-set--17" type="radio"><label class="tab-label" for="tab-set--17-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install -e <span class="p">&lt;</span>path&gt; </pre></div> </div> </div> </div> <p>You can also install normally from src</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--18-input--1" name="tab-set--18" type="radio"><label class="tab-label" for="tab-set--18-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>&lt;path&gt; </pre></div> </div> </div> <input class="tab-input" id="tab-set--18-input--2" name="tab-set--18" type="radio"><label class="tab-label" for="tab-set--18-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install <span class="p">&lt;</span>path&gt; </pre></div> </div> </div> </div> </section> <section id="installing-from-local-archives"> <h2>Installing from local archives<a class="headerlink" href="#installing-from-local-archives" title="Link to this heading">¶</a></h2> <p>Install a particular source archive file.</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--19-input--1" name="tab-set--19" type="radio"><label class="tab-label" for="tab-set--19-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>./downloads/SomeProject-1.0.4.tar.gz </pre></div> </div> </div> <input class="tab-input" id="tab-set--19-input--2" name="tab-set--19" type="radio"><label class="tab-label" for="tab-set--19-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install ./downloads/SomeProject-1.0.4.tar.gz </pre></div> </div> </div> </div> <p>Install from a local directory containing archives (and don’t check <a class="reference internal" href="../../glossary/#term-Python-Package-Index-PyPI"><span class="xref std std-term">PyPI</span></a>)</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--20-input--1" name="tab-set--20" type="radio"><label class="tab-label" for="tab-set--20-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--no-index<span class="w"> </span>--find-links<span class="o">=</span>file:///local/dir/<span class="w"> </span>SomeProject python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--no-index<span class="w"> </span>--find-links<span class="o">=</span>/local/dir/<span class="w"> </span>SomeProject python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--no-index<span class="w"> </span>--find-links<span class="o">=</span>relative/dir/<span class="w"> </span>SomeProject </pre></div> </div> </div> <input class="tab-input" id="tab-set--20-input--2" name="tab-set--20" type="radio"><label class="tab-label" for="tab-set--20-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install --no-index --find-links=file:///local/dir/ SomeProject py -m pip install --no-index --find-links=/local/dir/ SomeProject py -m pip install --no-index --find-links=relative/dir/ SomeProject </pre></div> </div> </div> </div> </section> <section id="installing-from-other-sources"> <h2>Installing from other sources<a class="headerlink" href="#installing-from-other-sources" title="Link to this heading">¶</a></h2> <p>To install from other data sources (for example Amazon S3 storage) you can create a helper application that presents the data in a format compliant with the <a class="reference internal" href="../../specifications/simple-repository-api/#simple-repository-api"><span class="std std-ref">simple repository API</span></a>:, and use the <code class="docutils literal notranslate"><span class="pre">--extra-index-url</span></code> flag to direct pip to use that index.</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>./s3helper<span class="w"> </span>--port<span class="o">=</span><span class="m">7777</span> python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--extra-index-url<span class="w"> </span>http://localhost:7777<span class="w"> </span>SomeProject </pre></div> </div> </section> <section id="installing-prereleases"> <h2>Installing Prereleases<a class="headerlink" href="#installing-prereleases" title="Link to this heading">¶</a></h2> <p>Find pre-release and development versions, in addition to stable versions. By default, pip only finds stable versions.</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--21-input--1" name="tab-set--21" type="radio"><label class="tab-label" for="tab-set--21-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--pre<span class="w"> </span>SomeProject </pre></div> </div> </div> <input class="tab-input" id="tab-set--21-input--2" name="tab-set--21" type="radio"><label class="tab-label" for="tab-set--21-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install --pre SomeProject </pre></div> </div> </div> </div> </section> <section id="installing-extras"> <h2>Installing “Extras”<a class="headerlink" href="#installing-extras" title="Link to this heading">¶</a></h2> <p>Extras are optional “variants” of a package, which may include additional dependencies, and thereby enable additional functionality from the package. If you wish to install an extra for a package which you know publishes one, you can include it in the pip installation command:</p> <div class="tab-set docutils container"> <input checked="True" class="tab-input" id="tab-set--22-input--1" name="tab-set--22" type="radio"><label class="tab-label" for="tab-set--22-input--1">Unix/macOS</label><div class="tab-content docutils container"> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span><span class="s1">&#39;SomePackage[PDF]&#39;</span> python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span><span class="s1">&#39;SomePackage[PDF]==3.0&#39;</span> python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span><span class="s1">&#39;.[PDF]&#39;</span><span class="w"> </span><span class="c1"># editable project in current directory</span> </pre></div> </div> </div> <input class="tab-input" id="tab-set--22-input--2" name="tab-set--22" type="radio"><label class="tab-label" for="tab-set--22-input--2">Windows</label><div class="tab-content docutils container"> <div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -m pip install <span class="s2">&quot;SomePackage[PDF]&quot;</span> py -m pip install <span class="s2">&quot;SomePackage[PDF]==3.0&quot;</span> py -m pip install -e <span class="s2">&quot;.[PDF]&quot;</span> # editable project in current directory </pre></div> </div> </div> </div> <hr class="docutils" /> <aside class="footnote-list brackets"> <aside class="footnote brackets" id="id7" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id2">1</a><span class="fn-bracket">]</span></span> <p>“Secure” in this context means using a modern browser or a tool like <strong class="command">curl</strong> that verifies SSL certificates when downloading from https URLs.</p> </aside> <aside class="footnote brackets" id="id8" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id3">2</a><span class="fn-bracket">]</span></span> <p>Depending on your platform, this may require root or Administrator access. <a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> is currently considering changing this by <a class="reference external" href="https://github.com/pypa/pip/issues/1668">making user installs the default behavior</a>.</p> </aside> <aside class="footnote brackets" id="id9" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id4">3</a><span class="fn-bracket">]</span></span> <p>Beginning with Python 3.4, <code class="docutils literal notranslate"><span class="pre">venv</span></code> (a stdlib alternative to <a class="reference internal" href="../../key_projects/#virtualenv"><span class="std std-ref">virtualenv</span></a>) will create virtualenv environments with <code class="docutils literal notranslate"><span class="pre">pip</span></code> pre-installed, thereby making it an equal alternative to <a class="reference internal" href="../../key_projects/#virtualenv"><span class="std std-ref">virtualenv</span></a>.</p> </aside> <aside class="footnote brackets" id="id10" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id5">4</a><span class="fn-bracket">]</span></span> <p>The compatible release specifier was accepted in <span class="target" id="index-3"></span><a class="pep reference external" href="https://peps.python.org/pep-0440/"><strong>PEP 440</strong></a> and support was released in <a class="reference internal" href="../../key_projects/#setuptools"><span class="std std-ref">Setuptools</span></a> v8.0 and <a class="reference internal" href="../../key_projects/#pip"><span class="std std-ref">pip</span></a> v6.0</p> </aside> </aside> </section> </section> </article> </div> <footer> <div class="related-pages"> <a class="next-page" href="../managing-dependencies/"> <div class="page-info"> <div class="context"> <span>Next</span> </div> <div class="title">Managing Application Dependencies</div> </div> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> </a> <a class="prev-page" href="../"> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> <div class="page-info"> <div class="context"> <span>Previous</span> </div> <div class="title">Tutorials</div> </div> </a> </div> <div class="bottom-of-page"> <div class="left-details"> <div class="copyright"> Copyright &#169; 2013–2020, PyPA </div> Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s <a href="https://github.com/pradyunsg/furo">Furo</a> <div class="last-updated"> Last updated on Feb 14, 2025</div> </div> <div class="right-details"> </div> </div> </footer> </div> <aside class="toc-drawer"> <div class="toc-sticky toc-scroll"> <div class="toc-title-container"> <span class="toc-title"> On this page </span> </div> <div class="toc-tree-container"> <div class="toc-tree"> <ul> <li><a class="reference internal" href="#">Installing Packages</a><ul> <li><a class="reference internal" href="#requirements-for-installing-packages">Requirements for Installing Packages</a><ul> <li><a class="reference internal" href="#ensure-you-can-run-python-from-the-command-line">Ensure you can run Python from the command line</a></li> <li><a class="reference internal" href="#ensure-you-can-run-pip-from-the-command-line">Ensure you can run pip from the command line</a></li> <li><a class="reference internal" href="#ensure-pip-setuptools-and-wheel-are-up-to-date">Ensure pip, setuptools, and wheel are up to date</a></li> <li><a class="reference internal" href="#optionally-create-a-virtual-environment">Optionally, create a virtual environment</a></li> </ul> </li> <li><a class="reference internal" href="#creating-virtual-environments">Creating Virtual Environments</a></li> <li><a class="reference internal" href="#use-pip-for-installing">Use pip for Installing</a></li> <li><a class="reference internal" href="#installing-from-pypi">Installing from PyPI</a></li> <li><a class="reference internal" href="#source-distributions-vs-wheels">Source Distributions vs Wheels</a></li> <li><a class="reference internal" href="#upgrading-packages">Upgrading packages</a></li> <li><a class="reference internal" href="#installing-to-the-user-site">Installing to the User Site</a></li> <li><a class="reference internal" href="#requirements-files">Requirements files</a></li> <li><a class="reference internal" href="#installing-from-vcs">Installing from VCS</a></li> <li><a class="reference internal" href="#installing-from-other-indexes">Installing from other Indexes</a></li> <li><a class="reference internal" href="#installing-from-a-local-src-tree">Installing from a local src tree</a></li> <li><a class="reference internal" href="#installing-from-local-archives">Installing from local archives</a></li> <li><a class="reference internal" href="#installing-from-other-sources">Installing from other sources</a></li> <li><a class="reference internal" href="#installing-prereleases">Installing Prereleases</a></li> <li><a class="reference internal" href="#installing-extras">Installing “Extras”</a></li> </ul> </li> </ul> </div> </div> </div> </aside> </div> </div><script src="../../_static/documentation_options.js?v=187304be"></script> <script src="../../_static/doctools.js?v=888ff710"></script> <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script> <script src="../../_static/scripts/furo.js?v=5fa4622c"></script> <script src="../../_static/tabs.js?v=3ee01567"></script> <script src="../../_static/clipboard.min.js?v=a7894cd8"></script> <script src="../../_static/copybutton.js?v=cb5fb026"></script> <script data-domain="packaging.python.org" defer="defer" src="https://plausible.io/js/script.js"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10