Windows pip не является внутренней или внешней командой исполняемой программой или пакетным файлом

  • Home
  • News
  • How to Fix PIP Is Not Recognized in Windows Command Prompt?

How to Fix PIP Is Not Recognized in Windows Command Prompt?

By Vera | Follow |
Last Updated

When installing Python packages in Command Prompt, you may get the error message saying “’pip’ is not recognized as an internal or external command, operable program or batch file”. How can you fix the issue? MiniTool will show you some methods in this post.

PIP, Pip Installs Package, is a standard package management system. It is used to install and handle software packages written in Python. By default, most versions of Python have PIP installed.

When installing Python packages in the Command Prompt window, Windows will show you an error saying “’pip’ is not recognized as an internal or external command, operable program or batch file”.

The main reasons for PIP not recognized are because PIP installation is not added to the system variable or the installation is incorrectly added in your PATH. To fix this issue, you can follow some methods below.

Tip: Not recognized as an internal or external command is a common issue and it doesn’t only occur with PIP. This related article may be helpful to you – Not recognized Fix “Not Recognized As an Internal or External Command” Win 10.

Fixes for PIP Not Recognized

Check if PIP Is Added to the PATH Variable

Firstly you should know if your PIP installation is added to your PATH variable. Just do this thing through the following steps:

Step 1: Launch Command Prompt as administrator.

Step 2: Type echo %PATH% and press Enter. You can see a list of all the locations added to the PATH variable.

Step 3: Try to search for something similar to C:\Python37\Scripts. If you find one, this means the installation path has already been added to the PATH variable. If not, you need to add it to the variable.

Add PIP to the PATH Variable

Here are three options for you to do this work – use Windows GUI, a command line, and a Python executable installer.

Windows GUI

Step 1: Press Win + X, click Run, type sysdm.cpl, and click OK.

Step 2: Under the Advanced tab, click Environment Variables.

Step 3: Go to System variables, click Path > Edit.

environment variables

Step 4: Click New and type in C:\Python34\Scripts.

CMD

A quick way to add PIP to the PATH variable is using Command Prompt and now let’s see it.

Step 1: Run Command Prompt.

Step 2: Type setx PATH “%PATH%;C:\Python37\Scripts” and press Enter. Replace Python37 with your Python version.

Step 3: Then, run a Python installation package to see if “PIP is not recognized as an internal or external command” is fixed.

Use Python Executable Installer

Step 1: Run python –version in the CMD window to check the Python version installed.

Step 2: Go to Python.org to download the same version of the executable installer.

Step 3: Run the setup and choose Modify.

Step 4: Make sure the option of pip is selected.

Step 5: In the Advanced Options window, choose Add Python to environment variables and click Install.

Final Words

Have you got “PIP is not a recognized command”? Try to fix it by following the above methods and we hope you can easily get rid of the trouble.

About The Author

Position: Columnist

Vera is an editor of the MiniTool Team since 2016 who has more than 7 years’ writing experiences in the field of technical articles. Her articles mainly focus on disk & partition management, PC data recovery, video conversion, as well as PC backup & restore, helping users to solve some errors and issues when using their computers. In her spare times, she likes shopping, playing games and reading some articles.

Pip, also known as “PIP Installs Packages,” is a package organization system to install and operate Python software packages. Yes, it’s “Installs” and “Packages” with an “s.” It’s typically used for Python Package Index packages.

When installing Python packages, many users report receiving the message “‘pip’ is not recognized as an internal or external command” and aren’t sure how to troubleshoot. If you’re seeing this error, read on for tips on how to fix it.

The Causes for ‘Pip ‘is Not Recognized as an Internal or External Command Operable Program or Batch File

Let’s look at the two most common reasons for this error:

Reason #1: The Pip Install is Not in the System Variable

For Python commands to run from a Windows Command Prompt, the path of your pip install will need to be added to your “PATH” system variable. It should be added automatically if you obtained Python via the installation file.

Reason #2: The Installation Was Not Added to Your PATH or System Variables

If you’ve manually added the path, the problem could be a typo. One missing semicolon or an extra space somewhere will produce an error.

How to Fix ‘Pip ‘is Not Recognized as an Internal or External Command in Windows 10 or Visual Studio Code

If you see this error message when working in Windows or with Visual Code, it usually means a problem exists with the Python installation or the PATH has not been set correctly. Try the following tips to fix the issue:

Fix 1: Ensure Pip Was Added to Your PATH Variable

If you’re confident that pip got added to the PATH variable, move on to “Fix 3.” If not, continue here.

  1. Press “Windows key + R.” to open the “Run” dialog box.

  2. Type”cmd"and press “Enter.”

  3. For a list of all the locations added to your PATH variable, type echo %PATH% without quotes into the command prompt, then press “Enter.”

  4. The path was successfully added to the PATH variable if you find something like “C:\Python39\Scripts” (with the number depending on your Python version).

If pip hasn’t been added, try the next fix.

Fix 2: Add Pip to the PATH Environment Variable

There are two ways to add pip to the PATH environment variable—System Properties and the Command Prompt.

How to Add Pip to PATH Environment Variable using System Properties

  1. Open the “Run” dialog box by pressing the “Windows key + R.”

  2. Type insysdm.cpl and press “Enter” to access “System Properties.”

  3. Select the “Advanced” tab, then click “Environment Variables.”

  4. Go to the “System variables” section and select “Path,” then click the “Edit” button at the bottom.

  5. Click “New,” then add your pip installation path” followed by “Enter,” and then select “OK” to save it and close the window. The default location is: “C:\Python##\Scripts” with actual numbers, but your location and file version may differ.

  6. Once the path has been added, restart Windows (IMPORTANT), open a new command window, then try to install a pip package to see whether the problem was solved.

How to Add Pip to PATH Environment Variable using the Command Prompt

  1. Press “Windows key + R.” to launch the “Run” dialog box.

  2. For a new command prompt window, type cmd"and then hit “Enter.”

  3. Type the following command (with your actual path following the semicolon) and press “Enter” to run it:
    setx PATH "%PATH%;C:\Python39\Scripts"

Fix 3: Open the Python Package Without Adding the Pip Variable

Follow these steps to open Python install packages in CMD without adding the pip variable:

  1. Press the “Windows key + R” to open the “Run” prompt.

  2. Type”cmd"and press “Enter” to open the Command Prompt.

  3. Enter the following command for Python 3 (with the package name that uses pip), then press “Enter” to run it:
    py -m pip3 install "package name"

Fix 4: Ensure Pip is Included in the Installation

Some Python installers exclude pip from the default installation. You can fix this by changing the Python installer to include pip, and here’s how:

  1. Press the “Windows key + R” to open the “Run” prompt.

  2. Type appwiz.cpl and press “Enter.”

  3. In the “Program and Features” window, right-click “Python” and choose “Change.”

  4. Select “Modify.”

  5. In “Optional Features,” check the “pip” box and press “Next.”

  6. In the “Advanced Options” window, ensure “Add Python to environment variables” is checked.

  7. To apply the changes, click “Install.”

  8. When the installation is complete, open “Command Prompt” and verify whether you can install a Python package that uses pip without receiving the error.

If you still see the error, head to the last section of this article for steps to uninstall and reinstall Python.

This error usually means a problem with the Python installation exists, or the system variable PATH is not set up correctly. Try reinstalling Python and all its components to fix the problem. The easiest way is via the Python executable installer. Here’s how to do this:

  1. Press “Windows key + R” to open the “Run” dialog box.

  2. Type appwiz.cpl to get to the “Programs and Features” window.

  3. Scroll down the installed programs list to find the Python installation, NOT the launcher.

  4. Right-click it and select “Uninstall,” then follow the instructions.

  5. Once Python is removed, restart your computer (IMPORTANT) and download the latest Python installer for your OS.

  6. Execute “python-3.##.#-amd64.exe” (or whatever installer you downloaded) by double-clicking the file or using the Command Prompt.

  7. Ensure “Add Python 3.## to PATH” is checked at the bottom, then choose “Customize Installation.”

  8. In the “Optional Features” section, ensure the “pip” option is checked, then click “Next.”

  9. The default location can be left as is, but ensure “Add Python to environment variables” is checked, then click “Install.” You can also check off “Install Python 3.xx for all users” if desired.

  10. Once the installation is complete, install a Python 3 package that uses pip to see if the installation process works by typing the following:
    py -m pip install "Project Name Here"

Pip is Now Recognized

The “‘pip’ is not recognized as an internal or external command” error message is a common scenario. The cause usually boils down to the path of the pip install being unavailable or being added incorrectly to the system variable PATH. You can manually add it via Command Prompt or System Properties, change the Python install to include pip, or uninstall and reinstall Python and ensure the “pip” option and adding it to environmental variables are checked.

Nolrox

@Nolrox

Python-разработчик

Качаю Python, захожу в консоль, пишу pip install и выдает что «pip» не является внутренней или внешней командой, исполняемой программой или пакетным файлом. Что делать?


  • Вопрос задан

  • 90207 просмотров

Добавить в PATH.
Гугли переменные среды

Или даже будет быстрее переустановить питон и при установке поставить соответствующую галочку.

Если винда, то тут 99% что при установке не поставил галочку добавить пути в PATH.

1. Руками прописать
2. Удалить и поставить заново, не пропустив галочку

Скорее всего, у вас просто не была установлена галочка на работу пипа со всех директорий, или переустановите пайтон, почтавив эту галочку, илм пробуйте выполнять эту команду с директории где находится пайтон

Пригласить эксперта

Нужно обновить pip:
python -m pip install --upgrade pip
Скорее всего вы используете Python 3.9. Но многие мейнтейнеры не успели обновить пакеты. Поэтому установите Python 3.8
Discord.py поддерживается пока питоном 3.5 … 3.8!
И неплохо бы установить Microsoft C++ Build Tools, пригодится для установки некоторых пакетов.

если галочка PATH python не сработала можно: настроить ручную.
здесь объясняют как в ручную настроить PATH для python (для pip достаточно просто указать в PATH адрес к scripts в каталоге python)


  • Показать ещё
    Загружается…

Минуточку внимания

We come across the error, PiP is not recognized as an internal or external command when we try to install Python packages using a Command Prompt window.

As part of our Server Management Services, we assist our customers with several Python queries.

Today, let us discuss the error, PiP is not recognized as an internal or external command.

PiP is not recognized as an internal or external command

Most users make use of PiP to install and manage Python packages found in the Python Package Index.

PiP is not recognized as an internal or external command

This error means that the Python is either not installed or the system variable path has not been set.

Some customers report that the issue occurs even after installing the Python distribution and making sure that Python is in the path variable.

The major causes of this error include:

  • PIP installation is not added to the system variable

In order to run Python commands from a CMD window, we need to add the path of PiP installation to our PATH in the system variable.

  • The installation is incorrectly added in our PATH

When we add the PATH manually, additional space or a missing semicolon before the new PATH will end up in the error.

Solutions

Moving ahead, let us see the solutions our Support Techs employ in order to fix the error.

Method 1: Check if PIP is added to our PATH variable

  1. Type “cmd” in the Run prompt and press Enter.
  2. Inside the command prompt window, type echo %PATH% and press Enter to list all locations in the PATH variable.
  3. A path similar to C:\Python37\Scripts means that the installation path already exists in the PATH variable.

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

  1. Type “sysdm.cpl” in the Run prompt and press Enter.
  2. Inside the System Properties screen, go to Advanced tab >> Environment Variables.
  3. In there, go to System variables and click on Path to select it. Then click Edit…
  4. In the Edit environment variable screen, click on New and add the path where the PiP installation is located.
  5. Once done, we open a fresh CMD window install a python package that comes with PiP.

Method 3: AddPIP to the PATH environment variable using CMD

An easy way is to do it directly from a CMD window.

We follow the following steps to set the PiP path environment directly from a Command Prompt window:

  1. Type “cmd” in the Run prompt and press Enter to open a Command Prompt window.
  2. Then, run the following command to set the PIP installation to the environment variable:
    setx PATH “%PATH%;C:\Python37\Scripts”

In the command, we can change the Python version after ‘;‘ accordingly.

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

In order to do this, we can use a couple of different commands. This also works if we use the methods above to configure the environment PATH variable but still stuck with the error.

The Short Method:

  1. Type “cmd” in the Run prompt and press Enter.
  2. Then type the following commands and make sure to change the placeholder to our own package name:
    python -m pip install [packagename]

The Long Method:

  1. Type “cmd” in the Run prompt and hit Enter.
  2. In the CMD window, use the following command to navigate to the directory where the python .whl file is.
    cd C:\python installs
  3. Next, run the following command to install the Python package using pip:
    c:\python37\scripts\pip.exe install [package].whl

We change the location of our python installation according to the version or if we install it in a custom location. Also, make sure to change the [package] placeholder to our own package name.

Method 5: Ensure that PiP is included in Python installation

Before reinstalling the whole Python environment, we need to check whether PiP was not omitted from the Python installation. Certain Python installers will leave PiP out of the default installation.

We can rectify this by modifying the Python installation and modifying it to install PIP. Follow the steps given below:

  1. Type “appwiz.cpl” in the Run prompt and press Enter to open Programs and Features.
  2. Then, right-click on the Python installation and click Change.
  3. At the Modify Setup screen, click on Modify.
  4. In the Optional Features screen, check the box associated with pip and click Next.
  5. Then hit the Install button to make the changes to the Python installation.

Once done, open a CMD window and see if we are able to install a Python package with PiP without the error.

Method 6: Install Python via the executable installer

Reinstalling Python along with its components will likely resolve this error.

The easiest way is to use the Python executable installer. If we configure it correctly, it will automatically install PiP.

  1. Type “appwiz.cpl” in the Run prompt and press Enter to open Programs and Features.
  2. Scroll down to find the Python installation. Once we find it, right-click and choose Uninstall, then follow the on-screen prompts to remove it from our system. Once done, restart the machine.
  3. At the next startup, visit the URL given below and download the latest Python executable installer according to our OS architecture.
    https://www.python.org/downloads/windows/
  4. Open the installation executable and check the box near Add Python to PATH. Then, click on Customize installation.
  5. In the Optional Features window, make sure to check the box associated with pip, then click Next.
  6. Leave the default location and Advanced Options, then click Install to commence the installation.
  7. Once done, restart the computer manually.
  8. Then, try to install a Python package via a CMD window.
  9. If we are still seeing the error, type the following command in a CMD window:
    python -m ensurepip --default-pip

[Couldn’t solve the error? We are here for you]

Conclusion

In short, the error, “PiP is not recognized as an internal or external command” occurs when we try to install Python packages via a Command Prompt window.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

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

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.

    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.

    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.

    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.

    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.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows server 2008 r2 datacenter это
  • How to connect iphone to windows pc
  • Windows 7 заходит под временным профилем
  • Целевой диск для установки не может совпадать с диском текущей ос windows
  • Use a usb drive network connection or windows recovery dvd перевод