Add pip to path windows

So where is pip?

Assuming you chose the option to install pip via the installer, pip.exe should be located under the Scripts directory:

ex. Python/Scripts

pip.exe - Python Scripts Directory - Screenshot

So you should be able to add ex.:

 C:\Users\neubert\AppData\Local\Programs\Python\Python38\Scripts

to your environment variables if you want to allow access to the executables in Scripts globally via the command line.

However, while adding the Scripts directory to your Windows environment is useful (and I would recommend you do this for potential access to other exectuables created by Python), I would recommend NOT accessing pip like this.

Instead, you should use python -m pip in place of just pip. In short, this can help avoid possible headaches with «missing» modules when more than one copy of Python is installed on Windows (ex. if you need to use a copy of Python in a Python virtual environment for an isolated project).

В среде разработки на языке Python часто используется инструментарий для установки пакетов – Pip. Он позволяет легко устанавливать, обновлять и управлять сторонними пакетами, которые могут быть необходимы для работы с Python.

Для использования Pip в Windows, необходимо добавить его в переменную среды. Это позволит выполнять команды Pip из командной строки без необходимости указывать полный путь к исполняемому файлу.

Добавление Pip в переменную среды Windows можно выполнить следующим образом:

Шаг 1: Откройте окно «Системные свойства», нажав сочетание клавиш Win + Pause/Break.

Шаг 2: Нажмите на ссылку «Дополнительные параметры системы» в левой части окна.

Шаг 3: В открывшемся окне выберите вкладку «Дополнительно» и нажмите кнопку «Переменные среды».

Шаг 4: В разделе «Переменные среды пользователя» найдите переменную «Path» и нажмите кнопку «Изменить».

Шаг 5: В окне «Редактирование переменной среды» нажмите кнопку «Новый» и введите путь до директории с исполняемым файлом Pip.

Шаг 6: Нажмите кнопку «ОК» для сохранения изменений.

После добавления Pip в переменную среды Windows, команда Pip станет доступна из любой директории, и вы сможете устанавливать и обновлять пакеты Python без необходимости указывать полный путь к исполняемому файлу.

Содержание

  1. Что такое Pip и зачем он нужен
  2. Как установить Pip на Windows
  3. Добавление Pip в переменную среды Windows
  4. Открытие командной строки Windows
  5. Как настроить путь к Pip
  6. Проверка установки Pip
  7. Установка пакетов с помощью Pip

Пакеты являются ключевым компонентом разработки на языке Python. Они содержат готовый код и ресурсы, которые можно использовать в своих программах. Pip упрощает управление пакетами и их зависимостями в проектах Python, позволяя легко устанавливать нужные пакеты и поддерживать их актуальность.

Pip также является неотъемлемой частью виртуальных окружений. Виртуальное окружение – это изолированное пространство, где можно устанавливать и управлять пакетами независимо от других проектов. Это позволяет иметь разные версии пакетов для разных проектов и избежать конфликтов между зависимостями.

Использование Pip значительно упрощает процесс разработки на Python, позволяя быстро и удобно устанавливать и обновлять необходимые пакеты. Благодаря широкому выбору пакетов на PyPI, можно использовать готовые решения для реализации различных функций и повысить эффективность разработки.

Как установить Pip на Windows

Пакетный менеджер Pip (Python Installer Package) позволяет устанавливать и управлять пакетами Python на операционной системе Windows. Чтобы сделать это, следуйте инструкциям ниже:

  1. Перейдите на официальный сайт Python по адресу https://www.python.org/downloads/windows/.
  2. На странице загрузки выберите последнюю версию Python, совместимую с вашей операционной системой Windows. Это будет файл с расширением .msi.
  3. Запустите скачанный файл и следуйте инструкциям по установке Python.
  4. Убедитесь, что опция «Add Python to PATH» отмечена, чтобы добавить Python в переменную среды Windows.
  5. Завершите установку Python.
  6. Теперь, чтобы установить Pip, откройте командную строку (Command Prompt) на Windows.
  7. Введите команду python get-pip.py и нажмите Enter.
  8. Подождите, пока Pip будет установлен.
  9. Проверьте установку Pip, введя команду pip --version в командной строке. Если все прошло успешно, вы должны увидеть версию установленного Pip.

Теперь вы можете использовать Pip для установки и управления пакетами Python на вашей системе Windows.

Добавление Pip в переменную среды Windows

Для успешной установки и использования Pip необходимо добавить его путь к переменной среды Windows.

Шаги для добавления Pip в переменную среды Windows:

  1. Откройте меню «Пуск» и найдите «Система».
  2. Кликните правой кнопкой мыши на «Система» и выберите «Свойства».
  3. В открывшемся окне «Система» выберите «Дополнительные параметры системы».
  4. В новом окне выберите вкладку «Дополнительно» и нажмите кнопку «Переменные среды».
  5. В разделе «Переменные среды для пользователя» найдите переменную «Path».
  6. Выберите переменную «Path» и нажмите на кнопку «Изменить».
  7. В открывшемся окне нажмите кнопку «Новый» и введите путь к каталогу, где установлен Pip. Обычно путь выглядит как «C:\Python\Scripts» или «C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\Scripts».
  8. Подтвердите изменения, закрыв все открытые окна, нажав кнопку «ОК».

После выполнения этих шагов, Pip будет добавлен в переменную среды Windows и будет доступен из любой командной строки или среды разработки.

Настройка пути к переменной среды Windows позволит вам легко устанавливать и управлять пакетами Python с помощью Pip. Убедитесь, что вы используете правильную версию Python и Pip, чтобы избежать конфликтов или проблем совместимости.

Примечание: Если вы устанавливаете Python с помощью официального установщика Python, обычно Pip устанавливается автоматически и путь к нему добавляется в переменную среды Windows без необходимости дополнительной настройки.

Открытие командной строки Windows

Чтобы открыть командную строку в операционной системе Windows, следуйте этим шагам:

1. Нажмите клавишу Win + R

Для открытия окна «Выполнить» нажмите одновременно клавиши с логотипом Windows (Win) и R.

2. Введите «cmd»

В поле «Выполнить» введите текст «cmd» и нажмите клавишу Enter или нажмите кнопку «ОК».

3. Командная строка открыта

После выполнения предыдущего шага откроется окно командной строки, где вы можете вводить различные команды и запускать программы.

Примечание: В Windows 10 можно также открыть командную строку путем щелчка правой кнопкой мыши на кнопке «Пуск» и выбора в контекстном меню «Командная строка» или «Windows PowerShell».

Как настроить путь к Pip

Для того чтобы использовать Pip (Python Package Installer) из командной строки Windows, нам необходимо настроить путь к исполняемому файлу Pip.

  1. Откройте окно командной строки.
  2. Введите команду pip и нажмите Enter.

Если вы видите сообщение об ошибке, означающее, что ‘pip’ не является внутренней или внешней командой, значит путь к Pip не настроен. Следуйте инструкциям ниже, чтобы настроить его.

  1. Найдите путь к установленному Python на вашем компьютере. Обычно это будет C:\PythonXX\, где XX — номер версии Python.
  2. Откройте панель управления, выберите «Система и безопасность», затем «Система».
  3. Нажмите на «Дополнительные параметры системы» в левом меню.
  4. В открывшемся окне «Свойства системы» нажмите на кнопку «Переменные среды».
  5. В секции «Переменные среды для <имя пользователя>» (или «Системные переменные») найдите переменную среды «Path» и выделите ее, затем нажмите «Изменить».
  6. Добавьте следующий путь в список переменной «Path»: C:\PythonXX\Scripts\.
  7. Нажмите на кнопку «ОК» в каждом из открытых окон чтобы сохранить изменения.

Теперь путь к Pip должен быть настроен и вы можете использовать его из командной строки Windows. Повторно откройте окно командной строки и введите команду pip чтобы проверить, правильно ли настроен путь.

Примечание: Если вы не видите результатов после настройки пути к Pip, возможно вам понадобится перезагрузить компьютер для применения изменений.

Проверка установки Pip

После установки Pip в переменную среды Windows и настройки пути, нам необходимо убедиться, что установка прошла успешно и Pip работает правильно. Для этого можно выполнить следующие шаги:

  1. Откройте командную строку Windows, нажав Win + R и введя команду cmd. Нажмите Enter, чтобы открыть командную строку.

  2. Введите команду pip --version, чтобы проверить версию Pip. Если установка прошла успешно, вы увидите вывод с версией Pip.

  3. Вы также можете выполнить команду pip list, чтобы получить список установленных пакетов через Pip. Если список отображается без ошибок, значит Pip работает правильно.

Если команды pip --version или pip list не распознаются как команды, скорее всего Pip не был правильно добавлен в переменную среды Windows или путь не был настроен. В этом случае рекомендуется повторить шаги по настройке переменной среды и пути для Pip.

После успешной проверки установки Pip, вы готовы начать использование Pip для установки и управления пакетами Python.

Установка пакетов с помощью Pip

Чтобы установить пакет с помощью Pip, следуйте этим простым шагам:

  1. Откройте командную строку (CommandLine) или терминал (Terminal) в ОС Windows или Linux соответственно.
  2. Введите команду pip install и имя пакета, который вы хотите установить. Например, для установки пакета requests введите:
    pip install requests
  3. Нажмите клавишу Enter, и Pip начнет скачивание и установку выбранного пакета. Обычно процесс завершается в течение нескольких секунд.
  4. После завершения установки пакет будет доступен в вашей среде разработки Python и вы сможете использовать его в своих программах.

Обратите внимание: если вы уже установили Pip, но хотите обновить его до последней версии, воспользуйтесь командой pip install --upgrade pip.

Пример использования Pip: Допустим, вы хотите установить библиотеку numpy, которая широко используется для работы с массивами и матрицами в Python. Для этого введите команду:

pip install numpy

Теперь вы знаете, как устанавливать пакеты с помощью Pip и готовы начать разрабатывать программы на Python с дополнительными функциональными возможностями.

According to Statista, Python is the 4th most used programming language in the world (in 2022). Programmers often install it on their Windows computers to develop applications. However, we have seen users report that they often encounter trouble when trying to install or modify the Python packages using the “PIP” command.

The most common error reported amongst developers is the following:

Pip is not recognized as an internal or external command.

The Pip Installation Packages (PIP) is a Python package management system used to install and manage its software packages. However, while using it to perform certain tasks, like installing another package using the command “pip install Django”, the aforementioned error is encountered.

In this post, we are going to address this issue so that you may continue with your Python development as planned.

Table of contents

  • Why is Pip Command Not Found in Windows
  • How to Check Environment Variable for Pip
  • Fix PIP Not Recognized in Windows
    • Add Environment Variable for PIP
      • Add PIP Environment Variable using System Properties
      • Add PIP Environment Variable using Command Prompt
    • Edit Environment Variable for Python
    • Ensure PIP is Included in Python Installation
    • Reinstall Python with PATH Variable
    • Install Python Package without PIP Variable
  • Final Words

Why is Pip Command Not Found in Windows

When a user encounters the “Pip is not recognized as an internal or external command” error, it is due to one of the following reasons:

  • Pip has not been added to the environment variables.
  • The pip environment variable has incorrect values.

Environment variables are variables that can be used across your system. Just like in programming, variables contain a value that can be changed or called when needed. Environment variables are the same, but can be used across the entire scope.

When pp is not recognized, it is probably because the command line is unable to call on the actual program because of the missing or incorrect path.

Let us show you how to check whether a path for “pip” is present inside the Windows environment variables list.

How to Check Environment Variable for Pip

The most convenient method to check that pip was added to the PATH variable is using the Command Prompt. Follow these steps to check whether it is present or not:

  1. Launch an elevated Command Prompt.

  2. Run the following cmdlet:

    echo %PATH%
  3. Ensure that a similar path is present in the presented variables:

    C:\Users\[Username]\AppData\Local\Programs\Python\PythonXXX\Scripts

    Check if Python environment variable exists using Command Prompt

    Check if the Python environment variable exists using Command Prompt

    The username and the “XXX” are dependent upon your user account name and the installed Python version.

You can also view the environment variables from the Settings app, and through PowerShell.

If you find that such a variable doesn’t exist, then it means that the issue is caused because of a missing pip variable in PATH. However, if one does exist, then it is likely that its value is misconfigured.

Either way, continue to perform the following mitigation tasks to correct the error and get on with your Python development.

Fix PIP Not Recognized in Windows

Add Environment Variable for PIP

This section covers 2 ways to add the environment variable for PIP. Of course, you only need to perform this if the Python directory did not show up in the list of environment variables when you checked for them using the Command Prompt above.

Add PIP Environment Variable using System Properties

This method shows how to add the PIP environment variable to PATH using Windows GUI.

  1. Open the System Properties applet by typing in “sysdm.cpl” in the Run Command box.

    sysdm

    Open System Properties applet
  2. Switch to the Advanced tab.

    Open Advanced tab 1

    Open Advanced tab
  3. Click “Environment Variables.”

    Open Environment Variables

    Open Environment Variables
  4. Under the System Variables section, select “Path,” and then click Edit.

    Edit PATH

    Edit PATH
  5. From the popup window, click New.

    Add new environment variable

    Add new environment variable
  6. Now enter the path for the PythonXXX directory, as in the following image:

    Enter path for Python directory

    Enter path for Python directory

    Note: You can use File Explorer to navigate to the Python directory and copy the correct path from there.

    Copy path using File Explorer

    Copy path using File Explorer
  7. Now click New again and enter a second path for the Scripts directory.

    Enter path for Scripts directory

    Enter path for Scripts directory
  8. Click Ok on all windows to save the changes.

The environment variables will now be added to PATH.

Add PIP Environment Variable using Command Prompt

You can also add the PIP environment variable using the Command Prompt in just a few commands. Here is how:

  1. Launch an elevated Command Prompt.

  2. Use the following cmdlet while changing the [Username] and [XXX] with your account name and Python version to add the PIP environment variable to PATH:

    setx PATH “%PATH%; C:\Users\[Username]\AppData\Local\Programs\Python\PythonXXX

    Add path to Python directory using Command Prompt

    Add path to Python directory using Command Prompt

Edit Environment Variable for Python

If the Python directory did show up when you were checking the variables list, and the PIP command still isn’t working, then it is probably misconfigured.

Use the following steps to edit the existing PATH variable:

  1. Open the System Properties applet by typing in “sysdm.cpl” in the Run Command box.

    sysdm

    Open System Properties applet
  2. Switch to the Advanced tab.

    Open Advanced tab 1

    Open Advanced tab
  3. Click “Environment Variables.”

    Open Environment Variables

    Open Environment Variables
  4. Under the System Variables section, select “Path,” and then click Edit.

    Edit PATH

    Edit PATH
  5. Select the Python entry and click Edit.

    Edit the path

    Edit the path
  6. Repeat the steps above for the other path (if needed).

  7. Click Ok on all windows to save the changes.

Ensure PIP is Included in Python Installation

Python has different components installed. Ensure that PIP is one of the installed components using these steps:

  1. Open the Programs and Features applet by typing in “appwiz.cpl” in the Run Command box.

    appwiz

    Open Programs and Features applet
  2. Right-click Python and then click Modify from the context menu.

    Modify Python installation

    Modify Python installation

    The modification wizard will now launch.

  3. Click Modify.

    Select Modify

    Select Modify
  4. Make sure that “pip” is selected, then click Next.

    Ensure pip is selected

    Ensure “pip” is selected
  5. Now ensure that “Add Python to environment variables” is selected, and then click Install.

    Add environment variables

    Add environment variables

    Any newly selected packages and variables will now install.

  6. When the installation completes, close the wizard.

    Close the modification wizard

    Close the modification wizard

If this resolution did not work for you, you can try and reinstall Python all together.

Reinstall Python with PATH Variable

Another workaround for the error prompt is to reinstall Python on your PC. When installing Python, it gives you the option to place the environment variables into PATH.

Follow these steps to uninstall Python and then reinstall it properly.

  1. Open the Programs and Features applet by typing in “appwiz.cpl” in the Run Command box.

    appwiz

    Open Programs and Features applet
  2. Right-click Python and then click Uninstall.

    Uninstall Python

    Uninstall Python

    The uninstallation wizard will now run and remove Python from your PC.

  3. Close the wizard and restart the computer.

    Close uninstallation wizard 2

    Close uninstallation wizard
  4. Now download the Python setup and run it.

  5. From the installation wizard, select “Add pythno.exe to PATH” and then click “Install Now.”

    Add PATH for Python and install

    Add PATH for Python and install

    The installation will now begin.

  6. When installed, close the wizard.

    Close the installer

    Close the installer

A fresh environment variable path has now been added to the system. Check to see if your issue has been resolved and that PIP is recognized now.

Install Python Package without PIP Variable

If none of these solutions have worked for you, then another workaround is to install a Python package without adding the PIP variable. It can be done using a simple cmdlet in Command Prompt.

  1. Launch an elevated Command Prompt.

  2. Use the following cmdlet to install a Python package while replacing [PackageName] with the name of the package:

    python -m pip install [PackageName]

    Install Python package without PIP variable

    Install Python package without PIP variable

As you can see in the image above, the Django package has been installed without adding the pip variable in PATH.

Final Words

The Pip Installation Packages is a crucial command for managing Python libraries and packages. Therefore, you need to ensure that it is working correctly on your PC in order to maximize productivity.

Let us know which method from above worked for you in resolving the issue.

Some users trying to install Python packages using a Command Prompt window report seeing the “pip is not recognized as an internal or external command” error. Most affected users report that the issue occurs even after installing the Python distribution and making sure that Python is added to the path variable. The issue is not specific to a certain OS since it’s reported on Windows 7, Windows 8 and Windows 10.

pip' is not recognized as an internal or external command

pip’ is not recognized as an internal or external command Fix

What is PIP?

PiP is a recursive acronym for “Pip Installs Packages“. It’s essentially a package management system used to install and manage software packages written in Python. Most users make use of PiP to install and manage Python packages found in the Python Package Index.

The latest Python versions (Python 2.7.9 and later and Python 3.4) include Pip by default.

What is causing the ‘pip’ is not recognized as an internal or external command error?

We investigated this issue by looking at various user reports and trying to replicate the issue on our computers. From what we gathered, there are several scenarios that are known to trigger this particular error message:

  • PIP installation is not added to the system variable – In order to be able to run Python commands from a CMD window, you will need to add the path of your PiP installation to your PATH in the system variable. If you installed Python using the installation executable, it should be added automatically.
  • The installation is incorrectly added in your PATH – It’s easy to mess up the PATH if you add it manually. Additional space or the missing of a semicolon before the new PATH will end up producing the error.

If you’re currently trying to resolve this particular error message that prevents you from using Python command in CMD, follow the methods advertised in this article. All the potential fixes below are confirmed to be working by at least one affected users.

For the best results, follow the methods below in order until you find a fix that helps you to resolve the issue in your particular scenario.

Method 1: Checking if PIP is added to your PATH variable

Let’s start by finding out where we stand. If you don’t know if your PIP installation is added to your PATH variable, you can find it out easily by using a certain command at a CMD prompt.

Knowing this will point you in the right direction and save you from trying out unnecessary steps.

Note: If you already know if the path of your PIP installation is added to your PATH variable, move down to the next methods below.

Here’s a quick guide on checking if the PIP installation is already in your PATH variable:

  1. Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Enter to open up Command Prompt.Run dialog: cmd
    Run dialog: cmd
  2. Inside the command prompt window, type echo %PATH% and press Enter to get a listing with all locations added to the PATH variable.Checking to see if the PIP installation is present in the PATH variable
    Checking to see if the PIP installation is present in the PATH variable
  3. If you manage to find a path similar to C:\Python37\Scripts (this depends on your Python version), it means that the installation path is already added to your PATH variable. In this case, you can skip next to methods below and jump straight to Method 4 where we start troubleshooting for problems related to the PiP installation path.

If you weren’t able to find the PiP installation path using the test above, move down to the next methods below (Method 2 and Method 3) to add PIP to the PATH environment variable.

Method 2: Adding PIP to the PATH environment variable using the Windows GUI

If Method 1 revealed that the PIP installation is not set to the PATH as an environment variable and you already installed the Python distribution, you’ll need to do it manually.

After completing the procedure below, you will be able to input PiP commands from a Command Prompt window. Here’s a quick guide on Adding the PiP installation to the Path environment variable using the Windows GUI:

  1. Press Windows key + R to open up a Run dialog box. Then, type “sysdm.cpl” and press Enter to open up the System Properties screen.Run dialog: sysdm.cpl
    Run dialog: sysdm.cpl
  2. Inside the System Properties screen, go to the Advanced tab, then click on Environment Variables.go to the Advanced tab and click on Environment Variables
    Go to the Advanced tab and click on Environment Variables
  3. In the Environment Variables screen, go to System variables and click on Path to select it. Then with the Path selected, click the Edit… button.select the Path entry under System variables and click Edit
    Select the Path entry under System variables and click Edit
  4. In the Edit environment variable screen, click on New and add the path where the PiP installation is located. For Python 3.4, the default location is C:\Python34\Scripts.
    Adding the PiP installation location
    Adding the PiP installation location
  5. Once the path is added, open a fresh CMD window and try to install a python package that comes with PiP. You should no longer see the “pip is not recognized as an internal or external command” error.

If you’re looking for a quicker way to add the PiP location to the environment variable, follow Method 3.

Method 3: Adding PIP to the PATH environment variable using CMD

A quicker way to set up the PIP path environment variable is to do it directly from a CMD window. This will save you some time, but it can be a little more intimidating if you’re not used to using the terminal.

Here’s a quick guide on setting the PiP path environment directly from a Command Prompt window:

  1. Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Enter to open a Command Prompt window.Run dialog: cmd
    Run dialog: cmd
  2. In the Command Prompt window, run the following command to set the PIP installation to the environment variable:
    setx PATH “%PATH%;C:\Python37\Scripts”

    Note: Keep in mind that in this command, we used the default location for Python 3.7. If you’re using a different Python version or you installed it in a custom location, change the path after ‘;‘ accordingly.

  3. See if this method was successfully by running a Python installation package (one that uses PIP) from the same CMD window. If you’re still encountering the error message, move down to the next method below.

Method 4: Opening the Python package without adding the PiP variable

If you’re looking for a way to install a Python package from CMD without adding PiP to the PATH environment variable, you can use a couple of different commands to install it. This also works if you used the methods above to configure the environment PATH variable but you’re still encountering the error message.

Here’s a couple of ways that you can use to open Python install packages in CMD without adding the PIP variable:

The Short Method:

  1. Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Enter to open a Command Prompt Window.Run dialog: cmd
    Run dialog: cmd
  2. Type the following commands and make sure to change the placeholder to your own package name:
    python -m pip install [packagename]

    Note: Change [packagename] with the name of the package you’re trying to install.

The Long Method:

  1. Open a Run dialog box by pressing Windows key + R. Then, type “cmd” and hit Enter to open a Command Prompt window.Run dialog: cmd
    Run dialog: cmd
  2. In the CMD window, use the following command to navigate to the directory where the python .whl file is located.
    cd C:\python installs

    Note: In our example, the Python install package was located in a folder called python installs. Adapt this command to navigate to the directory where the wheel is located.

  3. Next, run the following command to install the Python package using PiP:
    c:\python37\scripts\pip.exe install [package].whl

    Note: Keep in mind need to change the location of your python installation if you have an older version or if you installed into a custom location. Also, make sure to change the [package] placeholder to your own package name.

If these two last methods didn’t enable you to install the Python package from the CMD window, follow the last method below where we ensure that PiP is installed.

Method 5: Ensuring that PiP is included in your Python installation

Before we go ahead and reinstall the whole Python environment, let’s see whether PiP was not omitted from the Python installation. Certain Python installers will leave PiP out of the default installation.

Luckily, you can rectify this by modifying the Python installation and modifying it to install PIP. Here’s a quick guide on how to do this:

  1. Press Windows key + R to open up a Run dialog box. Then, type “appwiz.cpl” and press Enter to open Programs and Features.
    Run dialog: appwiz.cpl
    Run dialog: appwiz.cpl
  2. Inside Programs and Features, right-click on the Python installation and click Change.Change Python installation
    Change the Python installation
  3. At the Modify Setup screen, click on Modify.
    Click on Modify to ensure that PiP is installed
    Click on Modify to ensure that PiP is installed
  4. In the Optional Features screen, check the box associated with pip and click Next.Modifying the Python installation to include PiP
    Modifying the Python installation to include PiP
  5. Hit the Install button to make the changes to the Python installation.Changing the Python installation
    Changing the Python installation
  6. Once the Python installation is modified, open a CMD window and see if you’re able to install a Python package with PiP without seeing the “pip is not recognized as an internal or external command” error.

Method 6: Installing Python via the executable installer

If you’ve come this far without a result, reinstalling Python along with its components will likely resolve the “pip is not recognized as an internal or external command” error.

The easiest way to do this is by using the Python executable installer. If you configure it correctly, it will install PiP automatically. Here’s a quick guide on how to do this:

  1. Press Windows key + R to open up a Run dialog box. Then, type “appwiz.cpl” and press Enter to open Programs and Features.Run dialog: appwiz.cpl
    Run dialog: appwiz.cpl
  2. Inside Programs and Features, scroll down to the programs list to find the Python installation. Once you find it, right-click on it and choose Uninstall, then follow the on-screen prompts to remove it from your system. Once the Python distribution is removed from your computer, restart your machine.Uninstalling Python from your machine
    Uninstalling Python from your machine
  3. At the next startup, visit this link (here) and download the latest Python executable installer according to your Os architecture.Downloading the right Python executable installer
    Downloading the right Python executable installer
  4. Open the installation executable and start by making sure that the box associated with Add Python to PATH is checked – This ensures that you can run Python commands in Command Prompt. Then, click on Customize installation.Ensure that Python is added to PATH, then click on Customize installation
    Ensure that Python is added to PATH, then click on Customize installation
  5. In the Optional Features window, make sure that the box associated with pip is checked, then click Next.Make sure that pip is checked under optional features
    Make sure that pip is checked under optional features
  6. Leave the default location and Advanced Options, then click Install to commence the installation.Installing Python
    Installing Python
  7. Once the installation is complete, restart your computer manually if you’re not automatically prompted to do so.
  8. At the next startup, see if the issue has been resolved by trying to install a Python package via a CMD window.
  9. If you’re still seeing the “pip is not recognized as an internal or external command” error, type the following command in a CMD window:
    python -m ensurepip --default-pip
    

    Note: With certain Python distributions (particularly 3.6), it’s possible that PiP doesn’t get installed by default. One of the official fixes for this included in the documentation is this command.

Photo of Kevin Arrows

Kevin Arrows

Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.

Prerequisite: Python Language Introduction

Before we start with how to install pip for Python on Windows, let’s first go through the basic introduction to Python. Python is a widely-used general-purpose, high-level programming language. Python is a programming language that lets you work quickly and integrate systems more efficiently. 

PIP is a package management system used to install and manage software packages/libraries written in Python. These files are stored in a large “online repository” termed as Python Package Index (PyPI). pip uses PyPI as the default source for packages and their dependencies. So whenever you type:

pip install package_name

pip will look for that package on PyPI and if found, it will download and install the package on your local system.

Check if Python is installed

Run the following command to test if python is installed or not. If not click here.

python --version

If it is installed, You will see something like this:

Python 3.10.0

Download and Install pip

The PIP can be downloaded and installed using the command line by going through the following steps:

Method 1: Using cURL in Python

Curl is a UNIX command that is used to send the PUT, GET, and POST requests to a URL. This tool is utilized for downloading files, testing REST APIs, etc.

Step 1: Open the cmd terminal 

Step 2: In python, a curl is a tool for transferring data requests to and from a server. Use the following command to request:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

Method 2: Manually install PIP on Windows

Pip must be manually installed on Windows. You might need to use the correct version of the file from pypa.io if you’re using an earlier version of Python or pip. Get the file and save it to a folder on your PC.

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed.

Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. 

Step 3: get-pip.py is a bootstrapping script that enables users to install pip in Python environments. Run the command given below:

python get-pip.py

Step 4: Now wait through the installation process. Voila! pip is now installed on your system.

Verification of the installation process

One can easily verify if the pip has been installed correctly by performing a version check on the same. Just go to the command line and execute the following command:

pip -V
or
pip --version

Adding PIP To Windows Environment Variables

If you are facing any path error then you can follow the following steps to add the pip to your PATH. You can follow the following steps to set the Path:

  • Go to System and Security > System in the Control Panel once it has been opened.
  • On the left side, click the Advanced system settings link.
  • Then select Environment Variables.
  • Double-click the PATH variable under System Variables.
  • Click New, and add the directory where pip is installed, e.g. C:Python33Scripts, and select OK.

Upgrading Pip On Windows

pip can be upgraded using the following command.

python -m pip install -U pip

Downgrading Pip On Windows

It may happen sometimes that your pip current pip version is not supporting your current version of python or machine for that you can downgrade your pip version with the following command. 
Note: You can mention the version you want to install 

python -m pip install pip==17.0

Last Updated :
17 Apr, 2023

Like Article

Save Article

  • Adbappcontrol exe скачать бесплатно для windows
  • Add an exception to the windows firewall for spacedesk
  • Add php to path windows
  • Adb что это за папка в windows 10
  • Address already in use windows