Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'pip' is not recognized as an internal or external command

I'm running into a weird error when trying to install Django on my computer.

This is the sequence that I typed into my command line:

C:\Python34> python get-pip.py Requirement already up-to-date: pip in c:\python34\lib\site-packages Cleaning up...  C:\Python34> pip install Django 'pip' is not recognized as an internal or external command, operable program or batch file.  C:\Python34> lib\site-packages\pip install Django 'lib\site-packages\pip' is not recognized as an internal or external command, operable program or batch file. 

What could be causing this?

This is what I get when I type in echo %PATH%:

C:\Python34>echo %PATH% C:\Program Files\ImageMagick-6.8.8-Q16;C:\Program Files (x86)\Intel\iCLS Client\ ;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\S ystem32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Progr am Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Mana gement Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine C omponents\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components \DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\P rogram Files (x86)\nodejs\;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x 86)\git\cmd;C:\RailsInstaller\Ruby2.0.0\bin;C:\RailsInstaller\Git\cmd;C:\RailsIn staller\Ruby1.9.3\bin;C:\Users\Javi\AppData\Roaming\npm 
like image 420
user3597950 Avatar asked May 17 '14 07:05

user3597950


People also ask

How do I enable pip in terminal?

In the Terminal, type python -m ensurepip or python3 -m ensurepip and press Enter. If PIP is missing, ensurepip will install PIP. Follow any additional on-screen instructions to complete this process. If you want to upgrade PIP, type python -m ensurepip –upgrade or python3 -m ensurepip –upgrade instead.

How do I enable pip in Python?

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 4: Now wait through the installation process.

How do you fix pip is not recognized as an internal or external command?

A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python on your computer. To fix it, you will either need to re-install Python and check the box to add Python to your PATH or install pip on your command line.

Why is pip install not working in Python?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.


2 Answers

You need to add the path of your pip installation to your PATH system variable. By default, pip is installed to C:\Python34\Scripts\pip (pip now comes bundled with new versions of python), so the path "C:\Python34\Scripts" needs to be added to your PATH variable.

To check if it is already in your PATH variable, type echo %PATH% at the CMD prompt

To add the path of your pip installation to your PATH variable, you can use the Control Panel or the setx command. For example:

setx PATH "%PATH%;C:\Python34\Scripts" 

Note: According to the official documentation, "[v]ariables set with setx variables are available in future command windows only, not in the current command window". In particular, you will need to start a new cmd.exe instance after entering the above command in order to utilize the new environment variable.

Thanks to Scott Bartell for pointing this out.

like image 177
fr1tz Avatar answered Oct 07 '22 19:10

fr1tz


For Windows, when you install a package, you type:

python -m pip install [packagename] 
like image 42
Yijing Shi Avatar answered Oct 07 '22 17:10

Yijing Shi