question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import requests ModuleNotFoundError: No module named 'requests'

See original GitHub issue

campaigns.py imports a module that is not in requirements.txt. This is currently causing a ModuleNotFoundError.

We can fix this in one of two ways:

  • Update the code to use the built-in urllib module
  • Add requests to requirements.txt

My preference is to use the urllib module which is built into python3.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dinagravescommented, Jun 30, 2021

In that case, it’s probably OK to leave it as is. I’ve already added requests to requirements.txt. If we run into any limitations with the module down the road, we can refactor it.

0reactions
ace-ncommented, Jun 29, 2021

I used requests out of habit. If we’d prefer to refactor this to use urllib, I’m fine with that.

(Of course, the easiest fix is probably adding requests to requirements.txt 🙂 )

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - ImportError: No module named requests
You get an import error because requests are not a built-in module instead, it is created by someone else ...
Read more >
[Fixed] ModuleNotFoundError: No module named 'requests'
How to Fix “ModuleNotFoundError: No module named 'requests'” in PyCharm · Open File > Settings > Project from the PyCharm menu. · Select...
Read more >
ModuleNotFoundError: No module named 'requests' in Python
The Python "ModuleNotFoundError: No module named 'requests'" occurs when we forget to install the requests module before importing it or install it in...
Read more >
ModuleNotFoundError: No module named 'requests' in Python 3
If you are getting "ModuleNotFoundError: No module named 'requests'" error then it means either requests module is not installed or if it is ......
Read more >
How to pip install the requests module to solve import errors?
No module named requests – even after i pip install ... Issue: you are still getting the import error even after executing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found