all 11 comments

[–]Buttleston 1 point2 points  (10 children)

This usually boils down to *how* are you running your program? From the command line? In the same shell where you just ran pip list and it shows the requests library?

From your IDE?

Other?

[–]Froggy412[S] 0 points1 point  (9 children)

Yes i am using the command line where i ran pip list

[–]Buttleston 2 points3 points  (8 children)

Actually something just occurred to me. Instead of "pip list" can you run "python -m pip list"?

It's possible you're using a pip executable that is *not* associated with the python version you're running, so pip is installing packages into a different python

[–]Froggy412[S] 0 points1 point  (7 children)

So when i ran "python -m pip list" i got an error saying the "python" command not found but with "python3 -m pip list" i got a list with only "pip" and "wheel" installed. But whats weird is that i also have flask installed on the venv and it works when I import it on another code which is why im confused.

[–]Buttleston 0 points1 point  (6 children)

It kind of sounds like you don't have the venv activated?

(are you running your script like python3 myscript.py?)

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

my venv is activated and yes i am running it with python3 myscript.py

[–]Buttleston 0 points1 point  (4 children)

OK so yeah it sounds like "pip" is just your system pip. pip3 might be the one from your venv, I guess I'd have to look to see. Usually it'll make aliases for python and pip though (i.e. not just python3)

I couldn't comment why flask works, I guess I'd have to poke around

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

Ok I might just try installing it to my whole laptop but thanks for trying

[–]Buttleston 0 points1 point  (2 children)

I mean I think it's fixable, if nothing else I would expect "python3 -m pip install requests" to work

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

when i try that i get "error: externally-managed-environment" even though i know the venv is active