pip3 : command not found

Ben Finney ben+python at benfinney.id.au
Sun Oct 30 20:37:50 EDT 2016


Vishal Subbiah <subbiahvishal at gmail.com> writes:

> So I wads trying to install some packages for python3. when I run pip3
> in terminal

There is no guarantee that a command named ‘pip3’ will be installed.

Instead, you should invoke the exact Python interpreter you want – and,
by extension, the Python environment into which you want packages
installed.

    $ /foo/bar/virtualenv/bin/python3 -m pip install LoremIpsum

If you already have a specific environment active and know that
‘python3’ is the correct Python interpreter from that environment, you
can omit the explicit path.

    $ python3 -m pip install LoremIpsum

----

Why doesn't a command ‘pip’ or ‘pip3’ do the job? Because there's no
guarantee that will use the specific Python environment you want.

For many programs, it simply doesn't matter which Python interpreter –
or even *whether* a Python interpreter or Perl interpreter or etc. – is
the one that runs.

So most Python-implemented programs you don't need to specify which
interpreter; they know how to find it themselves, and your choice of a
different environment should not affect their operation.

But for a command that has the primary purpose of interacting with that
environment – by installing or removing packages, as Pip does – it must
obey your explicit instruction on which Python environment and
interpreter to use.

-- 
 \           “It ain't so much the things we don't know that get us in |
  `\    trouble. It's the things we know that ain't so.” —Artemus Ward |
_o__)                                     (1834–1867), U.S. journalist |
Ben Finney




More information about the Python-list mailing list