Module not found

I’m getting “Module not found” errors for my Travis CI build:

import requests

url_ddg = ""

def test_ddg0():
    resp = requests.get(url_ddg + "/?q=DuckDuckGo&format=json")
    rsp_data = resp.json()
    assert "DuckDuckGo" in rsp_data["Heading"]

My travis.yml file contains this following code:

language: python
 - "3.8.2"
 - "nightly"
 - "pip install pytest"
 - "pip install -r requirements.txt"
script: python -m pytest

My requirements.txt file contains this:


I’m thinking that the requests module is not apart of your requirements.txt? If not, that’s the problem. On occasion requests is sometimes installed by default, but not usually in Linux distributions, so add requests to your requirements.txt so your requirements.txt file would look like this:

1 Like

this did it @montana, thanks!

No problem.