555

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
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user3597950
  • 9,201
  • 6
  • 26
  • 35
  • 9
    You may need to add pip to the PATH environment variable. Otherwise CMD prompt doesn't know what you're talking about – fr1tz May 17 '14 at 07:51
  • 1
    Hmm I'm relatively new to programming have only done some ruby on rails. Can you explain a bit more what you mean by PATH environment variable? How? – user3597950 May 17 '14 at 07:55
  • 1
    @fr1tz I get a huge output... seemingly a really really long directory of files – user3597950 May 17 '14 at 07:57
  • 1
    @user3597960 do you know the location of your pip installation? You need to add this location to that really really long list of directories, which is actually the PATH system variable. To add it to the PATH variable you can either use `setx PATH "%PATH%;C:\pip"` for example or you can add it via the control panel – fr1tz May 17 '14 at 07:59
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/53870/discussion-between-fr1tz-and-user3597950) – fr1tz May 17 '14 at 08:05
  • 3
    if the path of your Python\Python37-32\Scripts is too long like mine C:\Users\IT-admin\AppData\Local\Programs\Python\Python37-32\Scripts then command terminal trim the path and won't allow the addition of full path. In this case use the 'Advance system setting' from control panel to add manually as shown in screenshot by @KarthikeyanVK in below answer – Shriganesh Kolhe Feb 21 '19 at 07:31
  • `py -m pip install [package_name]` worked for me in PyCharm terminal – SaNa Aug 30 '20 at 08:59
  • Does this answer your question? [bash: pip: command not found](https://stackoverflow.com/questions/9780717/bash-pip-command-not-found) – Wenfang Du Sep 27 '21 at 04:05
  • In windows `right click` on `My Computer` or `The PC` then click on `properties` then on popup window go to `Advance System Setting` or `Advance` in win7 then click on `Environment Variables` then check `System variables` section and find ` Path` click on it then click on `Edit` and add the `Script` folder path here. The script path is most likely like this `C:\Users\User\AppData\Local\Programs\Python\Python310\Scripts` find your and add that here. – heySushil Aug 27 '22 at 04:48
  • 2023 and we still have to edit path variables. why is this so shitty? – Luke Jul 12 '23 at 09:45

42 Answers42

756

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.

fr1tz
  • 8,018
  • 1
  • 12
  • 8
  • This gives `"Fatal launcher error: Can't create execution environment"` – Nict Sep 05 '14 at 20:54
  • 17
    @fr1tz, the command did not work when being added from the cmd utility. I had to add it manually from system settings>advanced>environment variables. I am using Windows 8 64bit. Thanks! – Mohammed Jan 04 '15 at 17:19
  • 1
    After this, you need to install any package from that Directory i.e. C:\Python34\Scripts (For example) pip install openpyxl – Fahad Naeem Mar 13 '16 at 14:59
  • 36
    Note: you'll likely need to close and reopen your CMD prompt after you run the setx command. – Scott Bartell May 21 '16 at 22:07
  • 33
    For python 3.5 installed on Windows 10, the path is: C:\Users\\AppData\Local\Programs\Python\Python35 – derek Mar 05 '17 at 05:48
  • It worked but why the added is not showing in `system settings>advanced>environment variables>system variables>path`? – Pyd Jan 01 '18 at 08:57
  • does this apply no matter where you actually installed python on your machine? and I can't find "AppData" under username file. also running on windows 10.@derek – Jia Gao Mar 31 '18 at 07:01
  • 2
    _By default, pip is installed to_ -- by who's default? – Alex Gordon Apr 24 '18 at 18:04
  • do not forget to change version of python, for me it was `Python27` – zeroDivider Jun 06 '19 at 12:14
  • 1
    [Windows 10] If the path set is not working you can run it to navigate to the script folder run with pip3.7.exe C:\Users\\AppData\Local\Programs\Python\Python37\Scripts>pip3.7.exe install django==2.0.2 – Aryashree Pritikrishna Sep 26 '19 at 05:42
  • In my case the path location was "C:\Users\Jorge\AppData\Local\Programs\Python\Python39\Scripts" – Jorge Freitas Dec 16 '20 at 12:49
  • And yes, you don't have to add the "\pip" after the directory. Its sufficient to have it know till the Scripts. – Brookie_C Oct 16 '21 at 08:44
  • @AlexGordon by the default specified by the Python installer (in the case of this Q&A, the Windows installer for Python 3.4). – Karl Knechtel Jun 30 '22 at 07:01
  • For VS: C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64 – Pedro77 Jul 05 '22 at 01:36
  • I don't have/Scripts/ in my Python310 folder – Anatoly Bugakov Oct 13 '22 at 15:52
  • `setx` truncates strings, and will only tell you _after_ it's done it, see [here](https://superuser.com/q/387619). It warns you but does it anyway before you can abort. This makes this method a _real gamble_ because you better be prepared to have your PATH messed up if you have a lot of software. The default limits might have been increased since (I don't know by OS versions), but you should be aware of this limitation. – roganjosh May 03 '23 at 18:13
313

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

python -m pip install [packagename]
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Yijing Shi
  • 3,139
  • 1
  • 8
  • 3
  • 3
    I think these are the docs for the command `-m`: https://docs.python.org/2/using/cmdline.html?highlight=m#cmdoption-m – Marian07 Feb 09 '19 at 15:02
  • 11
    `'python' is not recognized`. I have it installed on my windows 10 – vsync Mar 27 '19 at 13:12
  • 66
    @vsync Try 'py' instead of 'python' – Vepir Apr 15 '19 at 22:44
  • This particular solution is great for Virtual Environments :) – Pedro Moisés Camacho Ureña Oct 08 '20 at 23:10
  • 1
    @Marian07 Your suggestion seem to be the only one that's working. I have tried some of the other suggestion about uninstalling pipenv because the virtual environments conflicting, not working. Thank you! – Chen Lizi Apr 20 '21 at 15:28
  • 7
    "py -m pip install [package]" in VS Code – Indrit Kello Aug 22 '21 at 21:13
  • @vsync you had to include the python version folder. You probably only ended at the python folder. What I mean is, you should add this to your path environment variables "C:\Users\DJOTCHUANG\AppData\Local\Programs\Python\Python38" not this "C:\Users\DJOTCHUANG\AppData\Local\Programs\Python\". This is for Python 3.8. You should include your own path of course. – Karl Djotchuang Tamo Aug 28 '21 at 16:39
  • This is far and away the best way to do it. It is platform-agnostic, works transparently with virtual environments, and - most importantly - doesn't require trying to figure out *what the path is* to *the correct* instance of `pip`. As long as `python` finds a (properly installed) version of Python, `python -m pip` means "the pip intended for use with the Python that is found by `python`". – Karl Knechtel Jun 30 '22 at 06:59
  • It's amazing that the Windows installer doesn't set all these paths up? Surely that would be job 2 after getting you the files for python? – Matthew Sep 01 '22 at 06:00
223

As of now, version 3.7.3 I had a little bit of an issue with getting the right system variable.

Try this:

  1. Type start %appdata% in cmd.

  2. After that file explorer should pop up in ../AppData/Roaming.

Go back one directory and navigate to Local/Programs/Python/Python37-32/Scripts.

NOTE: The version number may be different so if you copy and paste the above file path it could not work.

After you do this you now have the correct location of your downloaded Python. Copy your file path by selecting the whole directory in the address bar.

Enter image description here

Once you do that click the start icon and navigate to the Control PanelSystem and SecuritySystem. Then click "Advanced System Settings" on the left side of the panel.

Once there, click Environment Variables on the bottom right and there will be two boxes, an upper and a lower box. In the upper box: Click on the 'Path' Variable and click Edit located on the right. Click New and paste your directory Path. It should look something like this:

Enter image description here

Click OK three times, open a new window of cmd and type: pip. See if it works.

Thomas
  • 2,622
  • 1
  • 9
  • 16
  • 2
    Just wanted to highlight how comprehensive and helpful this was. I hope people link to it. – AwfulPersimmon Sep 25 '22 at 22:04
  • remember to restart the command line. It didn't work till I had done that. – Graham Thomas Feb 21 '23 at 20:16
  • Thanks for sharing. Especially useful for those who use Anaconda to locate where the pip file is when Anaconda was installed just for one user on the computer. And for those of you who are quick to alert me that Anaconda has a powershell too. I know. It doesn't like CLD2. – Simone Mar 21 '23 at 10:38
84

For me the command:

set PATH=%PATH%;C:\Python34\Scripts

worked immediately (try after echo %PATH% and you will see that your path has the value C:\Python34\Scripts).

Thanks to: Adding a directory to the PATH environment variable in Windows

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
zygimantus
  • 3,649
  • 4
  • 39
  • 54
  • 2
    This seems to work just as long as you don't close the cmd, setx will do it permanently – Ed_ Aug 04 '15 at 02:22
  • 2
    I really don't see how this deserved a seperate answer a year after the selected one. – fr1tz Jan 08 '16 at 00:02
  • 4
    @fr1tz this answer worked for me but not the previous one – gma992 Apr 06 '16 at 10:07
  • @gma992 I can't understand how. This answer says to do the exact same thing that the selected answer says to do, i.e., to modify the `PATH` environment variable in the same specific way. The only difference between `set` and `setx` is [which terminal sessions are affected](https://superuser.com/questions/916649). – Karl Knechtel Jun 30 '22 at 07:04
48

Alternate way.

If you don't want to add the PATH as the previous well written answers pointed out,

but you want to execute pip as your command then you can do that with py -m as prefix.

Given that you have to do it again and again.

eg.

py -m <command>

as in

py -m pip install --upgrade pip setuptools

Also make sure to have pip and py installed

enter image description here

Gian Marco
  • 22,140
  • 8
  • 55
  • 44
faruk13
  • 1,276
  • 1
  • 16
  • 23
  • While following this advise, I discover that my python installation had a "(1)" at the end of the .exe file name. After deleting the extra characters, python began wirking as expected – Running Buffalo Oct 07 '18 at 16:54
  • I think these are the docs for the command `-m`: https://docs.python.org/2/using/cmdline.html?highlight=m#cmdoption-m – Marian07 Feb 09 '19 at 15:05
  • i already installed python how can i add pip now? – myrccar May 19 '22 at 21:30
48

The only way that worked on my Windows 10 machine was as follows:

py -3 -m pip install xxxxx
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
HassanSh__3571619
  • 1,859
  • 1
  • 19
  • 18
25

Also, the long method - it was a last resort after trying all previous answers:

C:\python27\scripts\pip.exe install [package].whl

This after cd in directory where the wheel is located.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Colin Miles
  • 453
  • 5
  • 5
20

As per Python 3.6 Documentation

It is possible that pip does not get installed by default. One potential fix is:

python -m ensurepip --default-pip
Mohamed Ali JAMAOUI
  • 14,275
  • 14
  • 73
  • 117
  • This command will solve the issue on windows – MUK Feb 04 '21 at 12:45
  • I used this command but now if I install any package in base or my virtual environment, it automatically installs it in both. even if i create a environment, by doing pip list, it shows all the packages installed in base. How can I undo it. – MUK Feb 08 '21 at 12:27
  • Yes! Thank you! It worked (I don't care about the different environment issues suggested)! – M. Al Jumaily Mar 24 '23 at 17:36
16

Control Panel -> add/remove programs -> Python -> Modify -> optional Features (you can click everything) then press next -> Check "Add python to environment variables" -> Install

enter image description here

And that should solve your path issues, so jump to command prompt and you can use pip now.

Gus
  • 343
  • 3
  • 10
13

Try going to Windows PowerShell or cmd prompt and typing:

python -m pip install openpyxl
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
natty
  • 139
  • 1
  • 2
13

Go to control Panel >> Uninstall or change Program and double click on Python XXX to modify install. Make sure PIP component is checked and install.

enter image description here

JSON C11
  • 11,272
  • 7
  • 78
  • 65
Manjoo
  • 131
  • 1
  • 3
12

I was having the same problem just now.

After adding the proper folder (C:\Python33\Scripts) to the path, I still could not get pip to run. All it took was running pip.exe install -package- instead of pip install -package-.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Josh
  • 121
  • 1
  • 2
  • This worked for me, thanks. I have windows 10, 64 bit, 4 apps (problem probably partly comes from this fact) anaconda3 2020.11, python 3.7.0, python 3.9.1, python launcher. – ctde Apr 26 '21 at 23:49
9

In latest version Python 3.6.2 and above, is available in

C:\Program Files (x86)\Python36-32\Scripts

You can add the path to our environment variable path as below

Enter image description here

Make sure you close your command prompt or Git after setting up your path. Also should you open your command prompt in administrator mode. This is example for Windows 10.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Karthikeyan VK
  • 5,310
  • 3
  • 37
  • 50
8

Use

set Path = `%PATH%;C:\Python34\;C:\Python27\Scripts`

Source

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sajjad
  • 626
  • 1
  • 7
  • 25
4

Or if you are using PyCharm (2017-03-03) like me, just change directory in terminal and install:

cd C:\Users\{user}\PycharmProjects\test\venv\Scripts
pip install ..
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Fappie.
  • 482
  • 6
  • 18
3

Even I'm new to this, but pip install django worked for me.

The path should be set as where the script folder of the Python installation is, i.e.C:\Python34\Scripts.

I suppose it's because Django is a framework which is based on Python, and that's why this directory structure has to be maintained while installing.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
3

I have just installed Python 3.6.2.

I got the path as

C:\Users\USERNAME\AppData\Local\Programs\Python\Python36-32\Scripts

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sanjeev shetty
  • 438
  • 4
  • 17
3

In Windows, open cmd and find the location of PYTHON_HOME using where python. Now add this location to your environment variable PATH using:

set PATH=%PATH%;<PYTHON_HOME>\Scripts

Or refer to this.


In Linux, open a terminal and find the location of PYTHON_HOME using which python. Now add the PYTHON_HOME/Scripts to the PATH variable using:

PATH=$PATH:<PYTHON_HOME>\Scripts
export PATH
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ani Menon
  • 27,209
  • 16
  • 105
  • 126
3

You can try pip3. Something like:

pip3 install pandas
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
3

Most frequently it is:

in cmd.exe write

python -m pip install --user [name of your module here without brackets]
Kokokoko
  • 452
  • 1
  • 8
  • 19
3

None of these actually worked for me, but running

python -m pip install -U pip

and then adding the specified directory to the PATH as suggested got it working

2

I was facing the same issue. Run Windows PowerShell as Administrator. It resolved my issue.

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Kamran
  • 669
  • 6
  • 9
2

In your Python folder path in Terminal, just type

  py -m pip

in order to check the current version of your pip. You will also see a list of commands, you can use...

enter image description here

Geographos
  • 827
  • 2
  • 23
  • 57
1

I think from Python 2.7.9 and higher pip comes pre installed and it will be in your scripts folder.

So you have to add the "scripts" folder to the path. Mine is installed in C:\Python27\Scripts. Check yours to see what your path is so that you can alter the below accordingly. Then go to PowerShell, paste the below code in PowerShell and hit Enter key. After that, reboot and your issue will be resolved.

[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\Scripts", "User")
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
poodytang
  • 21
  • 1
1

In a Windows environment, just execute the below commands in a DOS shell.

path=%path%;D:\Program Files\python3.6.4\Scripts; (new path=current path;path of the Python script folder)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Baiju Chandran
  • 450
  • 4
  • 6
1

I deleted the older version using the control panel and then installed the new version however the newer version was not reflecting pip even after adding the right paths in the environment variables. However, the thing that worked for me was deleting the folders of old python that were there in the local App folder even after uninstall. For me, the path was like below. Deleting this folder solved my issue

C:\Users\username\AppData\Local\Programs\Python38
Ali Mohsan
  • 326
  • 2
  • 15
1

First of all, check the pip version, and its existence on machine

 pip --version

or

 pip3 --version

If you in case pip is not installed then install it.

On Linux, you can install pip3 by running an apt-get command in your terminal.

sudo apt-get -y install python3-pip

On Mac, pip is bundled with the Python distributable, so you need to re-install Python

brew uninstall --ignore-dependencies python3 && brew install python3

On window this issue occurs when pip is not correct in the PATH file

You can try below py prefix alternative to make it work

python -m pip install [packagename]

To set pip PATH [Reffer to Ani Menon Answer for details]

Find the location of PYTHON_HOME using

where python

Now add this location to your environment variable PATH using

set PATH=%PATH%;<PYTHON_HOME>\Scripts

Or

On Linux, open a terminal and find the location of PYTHON_HOME using

which python

Now add the PYTHON_HOME/Scripts to the PATH variable using:

PATH=$PATH:<PYTHON_HOME>\Scripts
export PATH
Umar Hayat
  • 4,300
  • 1
  • 12
  • 27
1

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

pip is a python module used to install packages. For your problem, there can be many reasons;

  • Restart CMD/Terminal
  • Environment variable is not set. pip is installed but environment variable is not set. Environment variable is a windows variable where pip path is saved, so it can be run at run time.
  • pip is not installed.

Restart CMD/Terminal

It is sometimes possible that you opened your command prompt or terminal before installing pip and now it just needs a restart to pick up the latest environment variables. It is worth trying just restarting your command prompt or terminal.

Environment Variable is Not Set

Open CMD and run this command to see the values set in the PATH environment variable.

echo %PATH%

This will echo the PATH environment variable like this; enter image description here

You should check if your path exist in the echoed PATH list. For example, in my case, the path for pip.exe files is C:\Python310\Scripts. You can check this path yourself like this; enter image description here

If you can find pip path and it does not exist the echoed PATH variable, then we need to add it. Copy the path like C:\Python310\Scripts.

Go to Start > This PC > Properties > Advance system settings > Advanced > Environment Variables

enter image description here

As shown in the image above, Select Path, click Edit button and add the copied path. Restart the CMD and test pip command again.

pip is Not Installed

If pip is not installed, you can install it again by downloading latest python.exe setup from python.org website. Make sure you check mark the pip option as shown in the image below. enter image description here

In the next step, check mark "Add Python to environment variables" enter image description here

Umair Anwar
  • 522
  • 1
  • 4
  • 15
1

Windows: the only solution that worked for me is:

1 navigate to C:\Users\username\AppData\Local\Programs\Python\Python310\Scripts

2 copy the path

3 open Environment variables > system variables

4 paste

enter image description here

After that PIP should work correctly!

enter image description here

vlatko606
  • 909
  • 1
  • 13
  • 21
1

For Windows users:
Open your Python's scripts folder; it's usually located in this path:
C:\Users\<USER>\AppData\Local\Programs\Python\Python<VERSION>\Scripts,
for example: C:\Users\elyas\AppData\Local\Programs\Python\Python311\Scripts.

Then, see if there is a pip executable file, if you don't see one, run this CMD command: python -m ensurepip --upgrade
If you do see a pip executable file, look at it's name, and run it in CMD. For example, I have a pip3.exe file, so in CMD I run pip3. If the command is not recognized, then make sure the scripts folder is in the system's PATH variables:

  1. Open CMD in Admin mode
  2. Run this command: rundll32.exe sysdm.cpl,EditEnvironmentVariables
  3. Under system variables, edit Path to see its content.
  4. Make sure the Python folder and the Python's scripts folder are present. If they are not in the list - add them.
Elyasaf755
  • 2,239
  • 18
  • 24
1

Hi I tried all these methods and watched so many utube videos regarding this and nothing work for me.

Finally I tried this way and it worked.

In my case only the Pip was only not identified.

Go to this site. https://bootstrap.pypa.io/get-pip.py

download that file by right clicking on that page. create new folder and put that file in to that folder. Navigate to that folder and open cmd inside that folder. Then type.

python get-pip.py

after that it will start to download. Like this in SS. enter image description here

after successfully installed close cmd and run again the cmd and type

pip --version

then in my case of course it shows like this

enter image description here

it worked. Most of these solutions related to setting the path in environmental variable . But my case in script folder there wasn't any file to be seen. I think the most easiest way is uninstall python through setup and delete other pip things then create new pip installation. if it isn't working the path setting to the Env. variables refer this youtube video. (Coppied from Youtube)

0

Small clarification: in "Windows 7 64 bit PC", after adding ...Python34\Scripts to the path variable, pip install pygame didn't work for me.

So I checked the "...Python34\Scripts" folder, it didn't have pip, but it had pip3 and pip3.4. So I ran pip3.4 install pygame .... .whl. It worked.

(Further open a command window in the same folder where you have the downloaded pygame...whl file.)

lenz
  • 5,658
  • 5
  • 24
  • 44
kosa
  • 262
  • 4
  • 17
0

I continued to receive this error after correcting my PATH.

If your codebase requires that you have an earlier version of Python (2.7 in my case), it may have been a version prior to the existence of pip.

It's not very canonical, but installing a more recent version worked for me. (I used 2.7.13.)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Womble
  • 345
  • 3
  • 13
0

I had this same issue. You just need to go to your

C:\Python27\Scripts

and add it to environment variables. After path setting just run pip.exe file on C:\Python27\Scripts and then try pip in cmd. But if nothing happens try running all pip applications like pip2.7 and pip2.exe. And pip will work like a charm.

shivam gupta
  • 471
  • 5
  • 10
0

A very simple way to get around this is to open the path where pip is installed in File Explorer, and click on the path, then type cmd, this sets the path, allowing you to install way easier.

I ran into the same issue a couple days ago and all the other methods didn't work for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

Try to uninstall Python, delete the remaining program files, and then install it again fresh.

It worked for me. This error happened to me when I migrated to a new laptop and used a migration software to move my software from the old laptop to the new one. And yeah, it didn't work quite well.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
0

For me the issue was the system was not restarted after adding the below in PATH:

C:\Users\admin\AppData\Local\Programs\Python\Python37\Scripts
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Muhammad Noman
  • 136
  • 1
  • 6
0

When installing SQL 2019 Python, there are known issues for PIP which require a fix (step 7) https://learn.microsoft.com/en-us/sql/advanced-analytics/known-issues-for-sql-server-machine-learning-services?view=sql-server-ver15

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Workaround
Copy the following files:

libssl-1_1-x64.dll
libcrypto-1_1-x64.dll

from the folder 
C:\Program Files\Microsoft SQL Server\MSSSQL15.MSSQLSERVER\PYTHON_SERVICES\Library\bin
to the folder 
C:\Program Files\Microsoft SQL Server\MSSSQL15.MSSQLSERVER\PYTHON_SERVICES\DLLs

Then open a new DOS command shell prompt.
Jamie
  • 437
  • 4
  • 15
0

For Mac, run the below command in a terminal window:

echo  export "PATH=$HOME/Library/Python/2.7/bin:$PATH"
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Lijo
  • 6,498
  • 5
  • 49
  • 60
0

So this error can we resolved very easily .

First of all you have to check if the pip is installed or not with python . For That you need to follow following method.

  1. open the python installation directory

    pip in c:\python34\lib\site-packages\

we supposes that you have installed python in c drive in python34 named folder. this will be definitely different for you .

  1. Under site-packages folder find pip folder . If it is, then all set, you just need to go for next step . If not Just refer to this tutorial to install it

Now Pip is installed in our system and you just need to configure it.

  1. Open the Python installation directory:

Here copy the path of installation directory ex :

C:\python38;
C:\python38\Scripts;

Here i am assuming that python is installed under C:\python38 directory. Please change accordingly.

  1. Now In windows Click on start Button and search :

    Environment Variable

3.Open edit the system environment Variable option.

  1. Under User variable choose Path and open it by clicking .

  2. Now click on add new and just add above copied path one by one .

  3. save it and close all tabs .

  4. Open cmd and type

    pip -V

    PS C:\Users\pro> pip -V
    pip 20.2.3 from c:\python38\lib\site-packages\pip (python 3.8)
    

Now Its Work.

Having Issue Let me know.

-1

For Python 2.7: Just use this command in Command Prompt [Run as administrator]:

mklink /H pip.exe c:\python27\Scripts\pip.exe

Result: Hardlink created for pip.exe <<===>> c:\python27\Scripts\pip.exe

And...done :)

-4

If you are working with Python, e.g. PyCharm, you should install the library to the Python library path like this:

pip install --target=C:\Users\<...>\lib <Library-Name>

real e.g.

pip install --target=C:\Users\devel\AppData\Local\Programs\Python\Python36\Lib requests <br>

PS: If you want to check if it's installed,

<Library-Name> --version

will not work correctly.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
safe89
  • 19
  • 2