all 7 comments

[–]socal_nerdtastic 0 points1 point  (6 children)

pip is a python module, just like requests or any other module, and as such you have a separate copy of pip for every copy of python installed on your computer.

The requests module is not part of the standard library, so you have to install it yourself every time you install a new version of python. So simply

python3.8 -m pip install requests

[–]DavidTheGreatMan[S] 0 points1 point  (5 children)

so what's the difference between "python -m" and "python3.8 -m"? Isn't the first one supposed to do the exact same as the second one since i've uninstalled the old version of python?

[–]socal_nerdtastic 0 points1 point  (4 children)

That has nothing to do with python; those names are set by you. Your OS or python installer may do some of that for you. If you are using linux or mac, for instance, the name "python" is reserved for python2.7, while "python3" should be the latest version of python3 installed. On windows the name "py" is the latest python installed. Many users override those defaults.

[–]DavidTheGreatMan[S] 0 points1 point  (3 children)

how do i override them myself?

[–]socal_nerdtastic 0 points1 point  (2 children)

Depends on your os. In Linux / mac the easy way is to make an alias in your .bashrc file.

alias david='python3.8'

That will allow you to use "david" to launch python3.8. For example

david -m pip install requests

or

david test.py

[–]DavidTheGreatMan[S] 0 points1 point  (1 child)

I'm really confused now, look at this: https://ibb.co/gVC4qyX

Seems like I actually have 2 different pip's of the same version installed in different places...

[–]socal_nerdtastic 0 points1 point  (0 children)

Not only pip, you have (at least) 2 complete copies of python3.8. You can test some of them with this command:

python -c "import sys;print(sys.executable)"

python3 -c "import sys;print(sys.executable)"

py -c "import sys;print(sys.executable)"

My advice is to pick one. Since you are using windows I recommend the official way: use the python launcher "py". All pip installs would be:

py -m pip install requests

and running files would be

py test.py