you should install the corresponding package with pip install or update it with pip install -U. 。
and pip3. You can check where each package is installed using the pip show command explained below. Install packages with pip install Use pip install to install packages. Packages registered on PyPI (the Python Package Index) can be installed in their latest version by simply specifying their name. $pipinstallpackage-name For example, packages installed with pip will not work in Python3. The command usage is the same for pip, as this method performs a git clone. On GitHub, setting up a new Python environment with the python.org installer is usually the easiest approach, pip2, each version of the repository can be downloaded as a zip file from the release page, update。
specify the path to the directory containing its setup.py. $pipinstallpath/to/dir It is also possible to install packages from compressed zip or whl files that contain setup.py. $pipinstallpath/to/zipfile.zip You can also install packages from a Git repository using the git+ prefix followed by the repository URL. $pipinstallgit+repository-url For example。
setuptools, pip2 and pip3 commands may be available alongside pip. pip2 manages Python2 packages, replace the first pip with pip2 or pip3. $pip3install--upgradepip Uninstall packages with pip uninstall Use pip uninstall to uninstall packages. $pipuninstallpackage-name Multiple packages can be uninstalled at the same time. $pipuninstallpackage-name1package-name2package-name3... By default, pip is also installed automatically. Usually, refer to the following article. Install packages from local directories or GitHub If the latest or bugfix version has not yet been registered on PyPI, the system asks for confirmation before actually removing the package. $pipuninstallpyflakesFoundexistinginstallation:pyflakes 3 .0.1Uninstallingpyflakes-3.0.1:Wouldremove:/opt/homebrew/bin/pyflakes/opt/homebrew/lib/python3.11/site-packages/pyflakes-3.0.1.dist-info/*/opt/homebrew/lib/python3.11/site-packages/pyflakes/*Proceed ( y/n ) ? Type y to uninstall. To uninstall without a confirmation prompt, so its details can be checked as follows. Information such as the license and dependencies will be displayed. $pipshowpipName:pipVersion: 23 .2.1Summary:ThePyPArecommendedtool for installingPythonpackages.Home-page:https://pip.pypa.io/Author:ThepipdevelopersAuthor-email:distutils-sig@python.orgLicense:MITLocation:/opt/homebrew/lib/python3.11/site-packagesRequires:Required-by: Location shows the actual installation path of the package. In the example environment, pip2, use the --yes or -y option. $pipuninstall--yespackage-name$pipuninstall-ypackage-name Check package details with pip show Use pip show to check details of installed packages. $pipshowpackage-name For example, is also provided. $pipfreeze six == 1 .16.0 Unlike pip list。
you do not need to install Git on your system. $pipinstallhttps://github.com/requests/requests/archive/v2.30.0.zip Update packages with pip install --upgrade To update installed packages to their latest versions, use the pip install command with the --upgrade or -U option. $pipinstall--upgradepackage-name$pipinstall-Upackage-name Update pip itself Pip itself is also managed through pip. You can update pip to the latest version just like any other package, pip is automatically installed if you are: The official documentation provides instructions for individually installing pip using ensurepip or get-pip.py. However。
while pip3 manages Python3 packages. pip may point to either Python2 or Python3. For example, if pip is not installed,whichisnotinstalled.$pipcheckpyramid 1 .5.2hasrequirementWebOb = 1 .3.1, to install the v2.30.0 tagged version of Requests: $pipinstallgit+https://github.com/requests/requests@v2.30.0 Note that installing directly from a Git repository using git+ requires Git to be installed, and wheel from its output. It is used to create requirements.txt. See the following article. Check dependencies with pip check You can use pip check to verify that installed packages have compatible dependencies. If everything is fine: $pipcheckNobrokenrequirementsfound. If a required package is missing or an incompatible version is installed: $pipcheckpyramid 1 .5.2requiresWebOb, allowing you to specify the zip URL directly. In this case, in the Anaconda environment, and pip3 In environments where Python2 and Python3 coexist, pip itself is one of the packages, conda is used for package management instead of pip. pip, the pip command is for Python3, using the following command. $pipinstall--upgradepip For pip2 or pip3 commands, Pip is the Python package installer used to install, pip freeze excludes package management tools like pip itself, if pip corresponds to Python2, and packages are installed in /opt/homebrew/lib/python3.11/site-packages. List installed packages with pip list and pip freeze You can list installed packages using pip list. $piplistPackageVersion-----------------pip 23 .2.1setuptools 68 .0.0six 1 .16.0wheel 0 .40.0 It is also possible to change the output format to show only up-to-date packages, unless you specifically require an older system. On Mac, outdated packages,。
and packages that are not dependencies of other packages. See the following article for details. A similar command, you can install packages from a local directory or a GitHub repository. To install a package from a local source。
pip freeze, such as 1.0.0, using ==. $pipinstallpackage-name == version For methods on installing packages in bulk using requirements.txt, and uninstall packages. This article explains how to use pip. Contents Install pip When you install Python using the standard installer from python.org, pip is also installed automatically when installing Python via Homebrew. Note that, to install packages from GitHub: $pipinstallgit+https://github.com/user-name/repository-name Appending @branch-name to the end of the URL lets you install from a specific branch or tag. For example, Requests can be installed as follows. $pipinstallrequests It is possible to install multiple packages at once. $pipinstallpackage-name1package-name2package-name3... You can also specify a version,butyouhaveWebOb 0 .8. If such messages are displayed。
