Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75297

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

Newsgroups comp.lang.python
Date 2014-07-27 21:27 -0700
References <mailman.12374.1406519536.18130.python-list@python.org>
Message-ID <fb1fff77-bac8-4f6a-b1ff-0eb014db9d99@googlegroups.com> (permalink)
Subject Re: NameError: name 'requests' is not defined ?
From Miki Tebeka <miki.tebeka@gmail.com>

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

NameError: name 'requests' is not defined ? "水静流深" <1248283536@qq.com> - 2014-07-28 11:52 +0800
  Re: NameError: name 'requests' is not defined ? Miki Tebeka <miki.tebeka@gmail.com> - 2014-07-27 21:27 -0700
  Re: NameError: name 'requests' is not defined � Steven D'Aprano <steve@pearwood.info> - 2014-07-28 05:07 +0000

csiph-web