Trouble getting PIP for Python 3

Hi, I have looked around the web and can not find anything yet that can teach me how to get PIP for my computer. Can someone please explain where I can find it please?

Hi @wwweeeiiirrrddd000. As far as I’m aware pip typically comes with the standard Python distributions these days. Docs say it is included with Python 2 >=2.7.9 or Python 3 >=3.4. What version of python are you running?

You could also consider anaconda/miniconda which are covered in the CA lessons at some point though I don’t have the link to hand.

Firing something like python -V into your shell (or python3 -V) if you need an older version on the path) should give you that info.

Check the info at the following docs to ensure you actually have it and if for some reason you don’t follow the instructions for installation (note the warnings about changing system python/pip etc.)-

HI, i typed pip --version into my terminal and it gave this reply:
pip 20.1 from /Library/Python/2.7/site-packages/pip-20.1-py2.7.egg/pip (python 2.7)
and i downloaded python 3 but it keeps on returning python 2 when i type python -V

That sounds about right so you defintiely have pip for Python2.7.9 at least which would be your system’s distribution of Python (something you don’t want to mess with).

I don’t know how you installed a new dsitribution but it’s possible your commands are python3 and pip3 for working with the newer version you downloaded so as to ensure compatability. Try python3 -V and pip3 -V to ensure they’re both installed.

If this is troubling you could consider using a virtual environment using just one version of python in which case you could call commands with python and it would use only the given version when in that environment. Virtual environments are a good idea when you are working with different versions anyway.

Ok thanks, I do have python 3 since when I typed python3 -V it said python 3.8 but when i try pip3 -V it replies NameError: name ‘pip3’ is not defined

I’d still expect pip to be included with the Python3 install though I’m surprised it wasn’t added to your path as pip3. You might have to hunt down some guidance (best just to do quick search on how to add it to your path) which can vary a little depending on your OS and it’s current version.

You can probably still run it with python3 -m pip if you’re having trouble editing the path but in the long run adding it is probably easiest. That is entirely up to you though.

Keep the name as pip3 though so you’re not installing packages or confusing the system regarding which python version you’re working with. python and pip for the system and python3 and pip3 for the updated version.

Ok, thank you for your help.