Skip to content Skip to sidebar Skip to footer

Python No Module Named Serial / No Module Named Requests

This is the second time today this has happened.. I tried to import requests earlier and I got an Import Error: no module named requests Same thing for serial I googled the crap ou

Solution 1:

pip install requests
pip install pyserial

should do it (unless you don't have pip installed)

Solution 2:

are you looking for urllib.requests? if you are using python 2.7 when you ask for requests you import urllib and you don't actually use request, but its methods are available to the urllib handle, so for instance:

urllib.urlopen("http://google.com")

will work in python 2.7.x, where

urllib.request.urlopen("http://google.com")

will work in python3.x.x

Post a Comment for "Python No Module Named Serial / No Module Named Requests"