目录
Install, uninstall, and upgrade packages
1 Manage packages in the Python Packages tool window
Manage package repositories管理软件包存储库
Install packages from Version Control System
2 Manage packages in Python interpreter settings
Install packages from conda package repository
Install, uninstall, and upgrade packages
安装、卸载和升级软件包
PyCharm provides methods for installing, uninstalling, and upgrading Python packages for a particular Python interpreter. It means that each project has its own set of packages, which is considered a best practice for Python dependency management.
By default, PyCharm uses pip to manage project packages.
For conda environments you can use the conda package manager.
PyCharm为特定的Python解释器提供了安装、卸载和升级Python包的方法。这意味着每个项目都有自己的一组包,这被认为是Python依赖管理的最佳实践。
默认情况下,PyCharm使用pip来管理项目包。
对于conda环境,您可以使用conda包管理器。
In PyCharm, you can preview and manage packages in the Python Packages tool window and in the Python interpreter settings.
在PyCharm中,您可以在Python Packages工具窗口和Python解释器设置中预览和管理包。
1 Manage packages in the Python Packages tool window
1 在Python包工具窗口中管理包
The Python Packages tool window provides the quickest and neat way to preview and install packages for the currently selected Python interpreter. This tool window is enabled by default, and you can open it by clicking Python Packages on the left. At any time you can open it using the main menu: View | Tool Windows | Python Packages.
Python Packages工具窗口提供了预览和安装当前所选Python解释器的包的最快速、最简洁的方法。默认情况下,此工具窗口处于启用状态,您可以通过单击左侧的
Python Packages打开它。您可以随时使用主菜单打开它:查看|工具窗口|Python包。
The Python Packages tool window shows installed packages and the packages available in the PyPI and conda package repositories. Use the search field to filter the list of the available packages.
Python Packages工具窗口显示已安装的包以及PyPI和conda包存储库中可用的包。使用搜索字段筛选可用程序包的列表。
You can preview the package documentation in the documentation area, or click the Documentation link and open it in a browser.
您可以在文档区域中预览软件包文档,或单击“文档”链接并在浏览器中打开它。
Install packages
安装软件包
-
Start typing the package name in the search field of the Python Packages tool window. The matching packages are displayed.
开始在Python Packages工具窗口的搜索字段中键入包名称。将显示匹配的包。If the current Python interpreter is a conda virtual environment, the packages available in the conda package repository are also displayed.
如果当前的Python解释器是conda虚拟环境,则也会显示conda包存储库中可用的包。 -
Select the package and then do one of the following:
选择包,然后执行以下操作之一:-
Click Install next to the package name and choose the version.
单击软件包名称旁边的安装并选择版本。
-