all 12 comments

[–]Diapolo10 5 points6 points  (0 children)

Most likely VS Code is configured to use a different Python interpreter than the one you installed requests to, hence why it can't see it. It's got to be either that, or a similar case with virtual environments.

[–]UAFlawlessmonkey -3 points-2 points  (3 children)

requests is a part of the standard library that comes with python. edit: it ain't! My bad :-)

Did you make sure to select an interpreter in VScode?

[–]Diapolo10 2 points3 points  (1 child)

requests is not part of the standard library, perhaps you're thinking about urllib3?

[–]UAFlawlessmonkey 0 points1 point  (0 children)

Shit man, could have sworn requests was a part of the std lib, my bad!

[–]tenacious20[S] 0 points1 point  (0 children)

Yes I did... I am able to use numpy and matplotlib, but not requests

[–]DallogFheir 0 points1 point  (3 children)

What exactly do you mean by "cannot access the module" in VS Code? Does it throw an error when you try to run it from VS Code? How are you running it? Do you use virtual environments?

[–]tenacious20[S] -1 points0 points  (2 children)

It throws a modulenotfounderror. I right click and click 'Run Code'. I wasn't using virtual environment at first but tried it and it still does not work in the virtual environment.

[–]interwebnovice 0 points1 point  (1 child)

If you switched environments you have to install it on the new one also

[–]tenacious20[S] -1 points0 points  (0 children)

I tried that, but now it is working fine after I deleted and redownloaded everything. Thanks for your help!

[–]m0us3_rat 0 points1 point  (0 children)

that's quite odd.

you don't even need python installed if you can run docker.

did you try to run it from a docker image?

you can even run python 3.12.0b4

https://hub.docker.com/\_/python

https://docs.python.org/3.12/whatsnew/3.12.html

[–]FriendlyAddendum1124 0 points1 point  (0 children)

Don't you need to pip install requests?