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.
In PyCharm, you can preview and manage packages in the Python Packages tool window and in the Python interpreter Settings .
Manage packages in the Python Packages tool window
This tool window is available in PyCharm 2021.1 and later
The Python Packages tool window provides the quickest and neat way to preview and install packages for the currently selected Python interpreter. This window is enabled by default, and you can find it in the lower group of the tool windows. At any time you can open it using the main menu: View | Tool Windows | Python Packages .
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 out the list of the available packages.
You can preview package documentation in the documentation area, or you can click the Documentation link and open the corresponding resource in a browser.
To delete an installed package, click in the upper-right corner of the Python Package tool window.
Install packages from repositories
- Start typing the package name in the Search field of the Python Package tool window. You should be able to see the number of the matching packages.

- Expand the list of the available versions in the upper-right corner of the tool window. Select the required version or keep it the latest.
- Click the Install with pip or Install with conda button next to the version list. Once PyCharm notifies you about successful installation, you should see the package in the list of the installed packages.

- If needed, click and provide a path to any custom repository you want to install from.
Manage package repositories
- To specify a custom repository, including devpi or PyPi, click on the Python Packages toolbar.

- In the Python Packages Repositories dialog, click to add a new repository. If no authorization is required, for example, in the case of a local repository, type the target URL and click OK .

- If you want to install Python packages from a repository that requires HTTP authorization, click Basic HTTP and type the repository URL and the login credentials. Click OK to complete the task.

Once the repository is added, it appears in the list of the repositories in the Python Packages tool window.
Install packages from Version Control System

- Click the Add Package link on the Python Packages toolbar and select From Version Control .
- Specify a path to the target git repository. For more information, refer to pip documentation for more information about supported path formats.
- Select Install as editable (-e) if you want to install a project in editable mode (for example, setuptools develop mode ).
Install packages from a local machine

- Click the Add Package link on the Python Packages toolbar and select From Disk .
- Specify a path to the package directory or an archive ( zip or whl ).
Manage packages in the Python interpreter settings
To manage Python packages for the Python interpreter, select the Python Interpreter page in the project Settings or select Interpreter Settings in the Python Interpreter selector on the Status bar .

If you select a Python interpreter with the configured Conda environment, the Use Conda Package Manager toggle appears in the packages area toolbar.

Use this toggle to install and upgrade packages from Conda package repositories. This toggle is enabled by default for Conda environments.
Install a package
- Click the button on the package toolbar.

- In the Available Packages dialog that opens, preview the list of the available packages and type the name of the package to install in the Search field.

- If required, select the following checkboxes:
- Specify version : if this checkbox is selected, you can select the desired version from the list of available versions. By default, the latest version is taken.
- Options : If this checkbox is selected, you can type the pip install command-line options in the text field.
- Install to user’s site packages directory : If this checkbox is left cleared (by default), then the packages will be installed into the current interpreter package directory. If the checkbox is selected, the packages will be installed into the specified directory. This option is not available for Conda environments.
- Select the target package and click Install Package .
If you’ve got any or error messages, consult the Troubleshooting guide for a solution.
Uninstall a package
- In the list of the packages, select the packages to be removed.
- Click Uninstall (). The selected packages are removed from the interpreter.
PyCharm smartly tracks the status of packages and recognizes outdated versions by showing the currently installed package version (column Version ), and the latest available version (column Latest version ). When a newer version of a package is detected, PyCharm marks it with the arrow sign and suggests upgrading it.
By default, the Latest version column shows only stable versions of the packages. If you want to extend the scope of the latest available versions to any pre-release versions (such as beta or release candidate ), click Show early releases .

Upgrade a package

- In the list of the packages, select the package to be upgraded.
- Click Upgrade ( ). The selected packages are upgraded to the latest available versions.
- Click OK to complete upgrading.
You can upgrade several packages at once. Hold Cmd (macOS) or Ctrl on (Unix or Windows), left-click to select several items in the list of packages, and then click Upgrade .
If you’re accustomed to installing packages from the command line, you can proceed with your workflow using the Terminal.
Reuse installed packages
- Create a new virtual environment and install packages that you want to be used in other projects. Then you can specify this virtual environment as a Python interpreter for the target project and all the needed packages will be available.
- In the Terminal window execute the following command: pip freeze > requirements.txt Then add the created requirements.txt file to the target project and PyCharm will prompt you to install the packages listed in the file.
SQLite
This functionality relies on the Database Tools and SQL plugin, which is bundled and enabled in PyCharm by default. If the relevant features aren’t available, make sure that you didn’t disable the plugin.
The Database Tools and SQL plugin is available only in PyCharm Professional.
- Press Control+Alt+S to open the IDE settings and then select Plugins .
- Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.
Official documentation and software
- For full information about SQLite, refer to the official documentation.
- To download SQLite database software, refer to the official software downloads.
This topic presents a general procedure on how you can create a data source for the connection to your SQLite database in PyCharm, and run a test connection. It is assumed that you already have the necessary prerequisites and the database is up and running. For example, if you want to run a database on your machine and connect to that database, the corresponding DBMS software must be installed on the machine first.
Connect to an SQLite database

- To connect to the database, create a data source that will store your connection details. You can do this using one of the following ways:
- From the main menu, navigate to File | New | Data Source and select SQLite .
- In the Database tool window ( View | Tool Windows | Database ) , click the New icon () in the toolbar. Navigate to Data Source and select SQLite .
- In the General tab of Data Sources and Drivers dialog right pane, specify the driver and connection type.
- In the Driver list, leave the default driver option, unless another driver is required for your connection.
- From the Connection type list, select the connection type depending on the connection details that you have:
- default : connect by using the path to SQLite database file.
- URL only : connect by using only the URL .
For the URL only connection type, the JDBC URL that you enter is used as is.
For the other connection types, the JDBC URL is broken down into connection details. You can either specify them separately and use the automatically generated URL, or you can enter the URL directly in the corresponding field.
You can also use your drivers for the database instead of the provided ones. For more information about connecting to a database with your driver, refer to Add a user driver to an existing connection. If there is no Download missing driver files link, then you already have the required drivers.
- To connect to an existing SQLite database, specify a file path to the database file in the File field. Alternatively, click the Open button () and navigate to the file.
- To create a new SQLite database, change the default identifier.sqlite name of the database, if needed. Alternatively, click the New button () and specify the name and location for your new database file.
- Also, to create a database, you can drag an SQLite database file to the Database tool window.
- In the URL field, PyCharm generates the JDBC URL automatically using the values of other connection settings. If you need to use a JDBC URL with certain additional settings, paste it in the URL field. The general URL to use is as follows:
- Format: jdbc:sqlite:/
- Example: jdbc:sqlite:/Users/JetBrains/db/myDatabase

- Paste the JDBC URL in the URL field.
- In the URL field, PyCharm generates the JDBC URL automatically using the values of other connection settings. If you need to use a JDBC URL with certain additional settings, paste it in the URL field. The general URL to use is as follows:
- Format: jdbc:sqlite::memory:
- Example: jdbc:sqlite::memory:

- Paste the JDBC URL in the URL field.
- In the URL field, PyCharm generates the JDBC URL automatically using the values of other connection settings. If you need to use a JDBC URL with certain additional settings, paste it in the URL field.
For the reference information about connection settings (for example, Host , Port , and so on) on the General and other tabs of Data Sources and Drivers dialog ( Command I ), see Data source settings.
In case of any connection issues, refer to the Cannot connect to a database page.
- For more information about the Database tool window, see the corresponding reference topic. To see more schemas under your new data source node, click the N of M button and select the ones you need. PyCharm will introspect and show them.

- For more information about working with database objects in PyCharm, refer to Database objects.
- To write and run queries, open the default query console by clicking the data source and pressing F4 .
- To view and edit data of a database object, open Data editor and viewer by double-clicking the object.
JSON
The JSON format is commonly used for storing data and for configuration files. PyCharm helps you work with JSON files — it checks their syntax and formatting. In popular types of configuration files, PyCharm provides code completion, thanks to the JSON Schema, which is a special format for describing the structure and contents of such files. You can also use custom JSON Schemas to enable code completion in your JSON files and validate them.
Enabling JSON5
PyCharm recognizes a number of most popular JSON standards including JSON5. PyCharm by default treats files with the json5 extension as JSON5 files and supports this new syntax in them.

Extend the JSON5 syntax to all JSON files
- In the Settings dialog ( Control+Alt+S ), go to Editor | File Types .
- In the Recognized File Types list, select JSON5 .
- In the File Name Patterns area, click and type *.json in the Add Wildcard dialog that opens.
Using schemas from JSON Schema Store
PyCharm can automatically download and use schemas from the JSON Schema Store that hosts schema files for many popular configuration files. As soon as you open a file whose name is associated with one of the available schemas (for example, tslint.json ), PyCharm downloads and uses this schema for it. The name of the applied schema is shown on the Status bar.

If your configuration file has a custom name, or you are working with a scratch file, click No JSON schema on the Status bar and select the required schema from the list or click New Schema Mapping to open the JSON Schema Mappings page and configure a new custom schema.

Schemas from the JSON Schema Store can be applied to YAML files as well.
By default, automatic download of Schemas from the JSON Schema Store is enabled. If it was turned off, you can enable it again at any time.
Enable automatic download schemas from the JSON Schema Store
- In the Settings dialog ( Control+Alt+S ), go to Languages & Frameworks | Schemas and DTDs | Remote JSON Schemas .
- Select the Allow downloading JSON schemas from remote sources and the Use schemastore.org JSON Schema catalog checkboxes.
PyCharm comes bundled with a number of popular schemas. Although these schemas are automatically updated on a regular basis they still may happen to be outdated.
Use the up-to-date versions of bundled schemas
- In the Settings dialog ( Control+Alt+S ), go to Languages & Frameworks | Schemas and DTDs | Remote JSON Schemas .
- Select the Always download the most recent version of schemas checkbox.
Using custom JSON schemas
Besides schemas from JSON Schema Store, PyCharm lets you configure and use custom schemas from other storages. You can download the required schema and store it under the project root or specify the URL of the resource so PyCharm can download the schema automatically.
Custom schemas must meet the JSON schema standards. Currently, PyCharm supports schemas draft-07 and earlier.
Configure a custom JSON schema
- In the Settings dialog ( Control+Alt+S ), go to Languages & Frameworks | Schemas and DTDs | JSON Schema Mappings .
- In the central pane, that shows all your previously configured custom Schemas, click on the toolbar.
- Specify the name of the Schema and the Schema Specification version with which your Schema complies. In the Schema file or URL field, specify the location of a previously downloaded Schema file or type the URL at which the required schema is available. If you specify a URL, make sure the Allow downloading JSON schemas from remote sources checkbox on the Remote JSON Schemas page is selected.
- Create a list of files or folders that you want to be validated against this Schema. Based on the list, PyCharm internally detects the files to be validated. The list may contain the names of specific files, the names of entire directories, and filename patterns. Use the following rules to specify filename patterns:
- role-* matches all files with the names that start with role- .
- role-*/**/*.yaml matches all .yaml files with names that contain role , / , and / .
- role-**.yaml matches all .yaml files with names that start with role- .
To add an item to the list, click and specify the path to a file or folder or type a file pattern.
PyCharm searches for files and folders with the specified names only within the current project, so you do not need to specify full paths to files and folders.
Enable automatic download of JSON schemas from remote sources
- In the Settings dialog ( Control+Alt+S ), go to Languages & Frameworks | Schemas and DTDs | Remote JSON Schemas .
- Select the Allow downloading JSON schemas from remote sources . When the checkbox is cleared, any network activity around JSON Schemas, including schemas from the JSON Schema Store, is disabled.
Handling conflicts among scopes of schemas
A conflict arises when a file, or a folder, or a pattern belongs to the scopes of two or more schemas. PyCharm analyzes scopes in two modes:
- Static Analysis detects conflicts in scopes of custom schemas. If a conflict is detected, PyCharm displays a warning in the Schema Details pane. To view the overlapping scopes, click the Show details link. PyCharm shows a popup with a message where the conflicting scopes and schemas are listed:

- Dynamic Analysis detects conflicts in scopes of both system and custom schemas. This type of analysis is started when you open a file that belongs to a certain scope. If a conflict is detected, PyCharm displays a warning at the top of the editor tab:
Click the link to open the JSON Schema Mappings page and edit the scope of the conflicting custom schema. Note that you cannot edit the scope of system schemas.
Using HTML descriptions in JSON schema
By default, PyCharm escapes HTML characters when displaying documentation for JSON schema definitions in documentation popups. To get nice looking documentation with rich HTML markup, store the HTML description in the x-intellij-html-description extension property instead of description .
< "id": "http://some.site.somewhere/entry-schema#", "$schema": "http://json-schema-org/draft-06/schema#", "type": "object", "required": [ "options" ], "properties": < "options": < "type": "array", "description": "Interesting details: Fresh New Awesome", "minItems": 1, "items": < "type": "string" >, «uniqueItems»: true, >, «readonly»: < "type": "boolean" >> >


Configuring syntax highlighting
You can configure JSON-aware syntax highlighting according to your preferences and habits.
- In the Settings dialog ( Control+Alt+S ), go to Editor | Color Scheme | JSON .
- Select the color scheme, accept the highlighting settings inherited from the defaults or customize them as described in Colors and fonts.
Как установить модуль requests в PyCharm?

Делаю : File — setting — project interpreter — жму плюс — выбираю из списка requests и получаю ошибку:
Прошу подсказки уважаемых форумчан о том, как установить в PyCharm эту библиотеку. Спасибо
- Вопрос задан более двух лет назад
- 1990 просмотров
Комментировать
Решения вопроса 1

Системный администратор
Так написано же в чём проблема. Просто переведи с английского и погугли про —build-dir
Найдёшь, например, PyCharm venv failed: ‘no such option: —build-dir’
Ответ написан более двух лет назад
Комментировать
Нравится 2 Комментировать
