1

I have tried to install libraries using pip but my console doesnt recognize as a command. I checked the python/scripts folder and there was no ppip.exe in the folder. I reinstalled Python 3.6 a couple of times but I havent been able to use it. I tried it on another computer and pip installed itself with python 3.6.

I've seen answers that say to open a Python shell, then insert

python -m pip install 'packagename'

but i tried this and the shell marked invalid syntax at the end of writing pip

  • 2
    Possible duplicate of [How to run Pip commands from CMD](https://stackoverflow.com/questions/29817447/how-to-run-pip-commands-from-cmd) – dangee1705 Mar 24 '18 at 18:11
  • You probably have to install `pip`. Take a look at the [pip documentation](https://pip.pypa.io/en/stable/installing/) for tips on how to install `pip` – sacuL Mar 24 '18 at 18:12
  • 1
    Maybe a path problem – Mathieu Mar 24 '18 at 18:16
  • 1
    What OS? Just search for pip.exe, go to the directory and run from there to see if it works. If yes, check your system/environment path settings. If there is a problem, reinstall. – Stacking For Heap Mar 24 '18 at 18:30

3 Answers3

0

on linux(ubuntu)

#for default 
sudo apt install python-pip

#for version specific
python2.7
sudo apt install python2-pip
for 3.x
sudo apt install python3-pip

for windows

Roushan
  • 3,046
  • 3
  • 15
  • 31
0

In some terminals try to use

$py -m pip install packagename 

Of course you first have to import pip with

$import pip

qd2d
  • 1
-1

if pip is installed the following will work for sure

open a python shell then

import pip

pip.main(['install', 'packagename'])

replace the packagename with the package you want to install

because of the path problem try to use absolute paths ( in windows beginning with drive letter i.e. C:/.../.../pip.exe). in batch script it is generally good idea to use absolute paths. Alternatively check if your path has to be fixed : https://docs.python.org/3/using/windows.html

( http://jelly.codes/articles/python-pip-module/ )

Operating systems search for executables in the system path. I.e. windows knows by default where its own executables are located because the directory is in the system path, however when new software is installed that contains executables like pip the system path has to be edited to inform windows ( or linux ) where the new executables are located. The path is an environment variable. This is also valid for other languages and programs like java ( Environment variables for java installation ) ,... Now your problem very likely is that the directory where the pip.exe executable is stored is not part of your windows path. This has to be fixed like in https://docs.python.org/3/using/windows.html, chapter 3.3. Configuring Python

How to run Pip commands from CMD

ralf htp
  • 8,134
  • 3
  • 19
  • 30
  • While this might help someone get something installed interactively and get them over the hurdle in the short term, it doesn't really help a person understand why pip isn't available on the command line or how to find it. – Maurice Reeves Mar 25 '18 at 14:36
  • This solved my issue. Thanks, ralf. Although I would like to know why one method works and not the other. – Diego Church Mar 27 '18 at 08:44