Как обновить pip в pycharm
Перейти к содержимому

Как обновить pip в pycharm

  • автор:

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.

Python Packages tool window

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

  1. 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. Install a package in the Python Packages tool window
  2. 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.
  3. 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. Installed package
  4. If needed, click and provide a path to any custom repository you want to install from.

Manage package repositories

  1. To specify a custom repository, including devpi or PyPi, click on the Python Packages toolbar. The icon to set custom repositories
  2. 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 . Adding a Python repository: No Authorization
  3. 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. Adding a Python repository: Basic HTTP Authorization

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

Install from Version Control

  1. Click the Add Package link on the Python Packages toolbar and select From Version Control .
  2. Specify a path to the target git repository. For more information, refer to pip documentation for more information about supported path formats.
  3. 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

Install package from disc

  1. Click the Add Package link on the Python Packages toolbar and select From Disk .
  2. 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 .

Viewing the installed Python packages

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

Using the Conda package manager

Use this toggle to install and upgrade packages from Conda package repositories. This toggle is enabled by default for Conda environments.

Install a package

  1. Click the button on the package toolbar. Add a package
  2. 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. Show available packages
  3. 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.
  4. 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

  1. In the list of the packages, select the packages to be removed.
  2. 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 .

Show latest available versions including beta and release candidates

Upgrade a package

Upgrading Python packages

  1. In the list of the packages, select the package to be upgraded.
  2. Click Upgrade ( ). The selected packages are upgraded to the latest available versions.
  3. 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.

обновление pip через pycharm

Ситуация такая — в папке site-packages находится две версии pip: 10 и 18. PyCharm цепляет 10. При попытке обновить через PyCharm, выдаёт ошибку:

Collecting pip==18.0 Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1045)’))) — skipping Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1045)’))) — skipping Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1045)’))’: /simple/pip/ No matching distribution found for pip==18.0

Удаление 10ой версии из папки также не помогает, как и python setup.py setup (всё устанавливается, но PyCharm по прежнему его не видит)

Как я могу обновить pip в PyCharm, когда у меня есть две версии python?

Изображение 210007

Я установил Python 2.7 и Python 3.5 в Windows 10. Я использую python 2.7 в моем текущем проекте PyCharm, а интерпретатор python проекта был настроен на python 2.7. Теперь я открываю PyCharm Settings, и я хочу обновить свой пипс python 2.7. Версия pip была 8.1.1, и я щелкнул обновление, ожидая, что оно будет обновлено до последней версии. Однако, после того, как он намекнул «обновить успешно», я заметил, что версия pip все еще была 8.1.1. Затем я понял, что PyCharm может использовать мою версию протокола по умолчанию в командной строке Windows — это python3.5 pip. Как решить эту проблему? Это ошибка?

guo 18 дек. 2016, в 10:43

How can I update pip in PyCharm when I have two versions of python?

enter image description here

I have installed Python 2.7 and Python 3.5 on Windows 10. I use python 2.7 in my current PyCharm project and the project’s python interpreter was set to python 2.7. Now I open PyCharm Settings and I want to update my pip of python 2.7. The pip version was 8.1.1 and I clicked update, expecting it to be updated to the latest version. However, after it hinted «update successfully», I noticed that the version of pip was still 8.1.1. Then I realized that PyCharm may use my default pip version in Windows command line—which is the python3.5’s pip. How to solve this problem? Is it a bug?

2,512 2 2 gold badges 21 21 silver badges 24 24 bronze badges
asked Dec 18, 2016 at 8:59
9,764 9 9 gold badges 43 43 silver badges 79 79 bronze badges

6 Answers 6

To update pip on pycharm:

  1. Open project settings (File > Settings. ) (preferences on Mac)
  2. Project > Project Interpreter
  3. Press the + button
  4. Type «pip» in the top search box
  5. In the lower right corner choose «specify version»
  6. Choose your version and press Install Package

image showing the screen

1,611 13 13 silver badges 10 10 bronze badges
answered Apr 3, 2018 at 10:36
Billion Shiferaw Billion Shiferaw
867 10 10 silver badges 20 20 bronze badges
after done this,the error happens «AttributeError:module’ object has no attribute ‘main'»
Apr 4, 2018 at 3:53

@dogewang probably because of this: mail.python.org/pipermail/distutils-sig/2017-October/… I guess something imports pip and runs the main function to install something

Apr 11, 2018 at 13:14

First of all, thanks. Second, I had done everything which you had said except ticking «Specify version». This is the only unintuitive part.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *