Re: NameError: name 'requests' is not defined ?

Miki Tebeka miki.tebeka at gmail.com
Mon Jul 28 00:27:49 EDT 2014


Greetings,

> there is only one line in mydown.py .
>  
> 
> import requests  
> ...
> >>> import mydown
> >>> requests.get(url)
> 
> Traceback (most recent call last):
> 
>   File "<stdin>", line 1, in <module>
> 
> NameError: name 'requests' is not defined
You need to call mydown.requests, but I think you're missing the point of modules and imports. I suggest you go over https://docs.python.org/3.4/tutorial/

HTH,
--
Miki



More information about the Python-list mailing list