Having trouble with 'py import requests' – any tips for a beginner? or Why does 'py import requests'

18 Replies, 1362 Views

Ah, the dreaded ModuleNotFoundError! Happens to everyone at least once.

For *py import requests* to work, you need to:
1. Install it (`pip install requests`)
2. Make sure you’re using the right Python env (virtualenv can help)

If it works sometimes and not others, you might be switching between Python versions. Check with `python --version` and `pip --version`.

Messages In This Thread



Users browsing this thread: 1 Guest(s)