77

I installed pip on Windows by downloading http://pypi.python.org/packages/source/p/pip/pip-1.0.2.tar.gz#md5=47ec6ff3f6d962696fe08d4c8264ad49 and running python setup.py install

Installation went fine with no errors.

But when I tried installing selenium package with it, it gives me the following error -

pip install -U selenium
Unknown option: u
Unknown or unsupported command 'install'

Where I'm making the mistake?

12 Answers 12

179

Do you happen to have the Perl pip lying around somewhere?

Sounds like the problem described here:

https://github.com/mike-perdide/gitbuster/issues/62

To check, in Windows command prompt execute:

C:\>where pip

This will potentially output the following:

C:\strawberry\perl\bin\pip
C:\strawberry\perl\bin\pip.bat

If so, this is your problem. Unistall Strawberry Perl or use the full path to python pip.

8
  • 1
    This is only pip(Python) installed on my system. Sep 19, 2011 at 12:19
  • Sure? Can you provide the output if you type just pip on the command line? Sep 19, 2011 at 12:22
  • 2
    In Python.org 2.7 the path is c:\Python27\Scripts\pip.
    – Leo
    Oct 24, 2015 at 13:07
  • 5
    I believe that uninstall is not really necessary, I have only to insert Python installation path before Strawberry on my PATH environment variable. Feb 22, 2016 at 16:50
  • 1
    Continuing with @ElvioMartinelli 's comment, I created additional system variables _PerlPath _PyPath, _zProgPath, etc with _zProgPath set to e.g. %_PyPath%;%_PerlPath%;%_AspPath%;%_SQLPath% and Path set to %_WinPath%;%_JavaPath%;%_zProPath%. Windows seems to expand environment variables in alphabetical order, which is what's up with the _s and _z to force evaluation of the first and second layers of variables before Path, which is now on the 3rd layer.
    – mpag
    Mar 2, 2016 at 22:17
19

This error is because the system is finding pip.bat before it finds pip.exe.

You do NOT need to uninstall Strawberry Perl or type the whole path.

What I do is to simply type pip.exe (same number of keystrokes as apt-get) when I want to use the Python utility. This method seems to work find for me on Win7 with Python(x,y) 2.7x and Strawberry Perl installed.

13

Had the same problem under Ubuntu and did:

$ sudo apt-get remove pip
$ sudo apt-get install python-pip
1
  • Thanks for the non-windows answer. Worked for me too, on Ubuntu.
    – Garfonzo
    Nov 25, 2013 at 6:50
13

I had this problem as well, and like Johannes said, it's because the perl pip is interfering with your Python pip.

To get around it, you can simply do this as well:

python -m pip install <package_name>

5

In addition to the very helpful nswer of Johannes: If you don't want to uninstalll Strawberry, you can re-arrange the order of PATH entrys in your Windows system to ensure your Python\Scripts are found before the strawberry entries. If you don't want to do this manually, you can use tools like the "Rapid Environment Editor".

5

You should provide path in environment variable for pip.exe file

while executing install command you should use below command

pip.exe install selenium 

This will surely work, for me this worked :)

4

You can also solve this problem without removing Strawberry Perl or type the whole path.Move to this C:\Python2.7\Scripts(your Python directory) directory,then use pip command.

3

For Python 3.X and above:

In the CMD prompt type:

py -m pip install  <package_name>

Make sure pip is installed already. Setup the environment variable for pip pointing to the exe file

To upgrade:

py -m pip install --upgrade pip
0

Same issue with DwimPerl. Uninstalling Dwim fixed the issue as well.

0

C:\Python27\Scripts\pip.exe install -U selenium

0

I have the same problem in windows 10, finally resolved the problem successfully.

I used the following command where pip

I was showing multiple installations of pip. Once removed other installation it worked fine.

0

open cmd and type where pip and you will have

C:\Dwimperl\perl\bin\pip.bat
C:\Dwimperl\perl\bin
C:\Users\athus\AppData\Local\Programs\Python\Python38-32\Scripts\pip.exe

and go to C:\Dwimperl\perl and delete bin folder. and again type where pip and you will only have

C:\Users\athus\AppData\Local\Programs\Python\Python38-32\Scripts\pip.exe

and enjoy python pip.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.