vriv
vriv

Reputation: 21

can't open file 'pip': [Errno 2] No such file or directory

I am trying to install Jinja2 package with following command line

python pip install Jinja2

and I get the error

can't open file 'pip': [Errno 2] No such file or directory

I checked and pip is both in my python Lib and Script so I don't understand.

Also tried

python pip -m install Jinja2

It is not the first time I get the error but I can't remember how I worked it out last time.

Upvotes: 1

Views: 12685

Answers (1)

gorandp
gorandp

Reputation: 563

Here is a solution from this question. Which is also what miles82 said in this question.

python -m pip install SomePackage

But it doesn't have an explanation. So, to complete that answer, if you type:

python -h

It returns a help text, and we can see that -m means:

-m mod : run library module as a script (terminates option list)

And that's why you type pip as a library module after -m, so you can download your desire package.

(I'm new to python, so if I got some wrong, feel free to correct me).

Upvotes: 6

Related Questions