No module named 'requests' when it is installed?

I have the module requests installed, but when i run it it tells me it is not.

Can you be more specific? How did you install the requests module? How
are you “running” it? What output do you get?

Please copy/paste output text between code fences in your reply, eg:

 ```
 your output text
 goes here
 ```

There’s a </> button in the compose menu to make such a section.

The usual reason for this is that you have installed the requests
module in a diferent Python that the Python you’reusing to “run” it.

Cheers,
Cameron Simpson cs@cskk.id.au

I mean starting the script.

Please copy/paste the complete text, not a screenshot. Screenshots
cannot be copy/pasted as text and are a problem for people using the
email interface and the visually impaired.

We like the entire traceback and the command which was issued to cause
it.

I notice there’s a .vscode in you file path. Are you using VSCode?

Maybe the requests package has not been installing in the Python which
VSCode is using. I believe it has a menu to select a Python interpreter
and might have one for installing packagings into whichever interpreter
you’re using.

Cheers,
Cameron Simpson cs@cskk.id.au

1 Like

If you’re running a script by running python script.py, try running python -m pip install requests to install it in that python environment

1 Like