# Pico W NameError: name 'network' isn't defined

**URL:** <https://forum.core-electronics.com.au/t/pico-w-nameerror-name-network-isnt-defined/15832>\
**Category:** Uncategorized\
**Created:** [7 December 2022 09:03 UTC](https://forum.core-electronics.com.au/t/pico-w-nameerror-name-network-isnt-defined/15832 "2022-12-07T09:03:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [7 December 2022 09:03 UTC](https://forum.core-electronics.com.au/t/pico-w-nameerror-name-network-isnt-defined/15832/1 "2022-12-07T09:03:03Z")

</div>

Hi Guys,  
I have recently purchased a Raspberry PI Pico W and I’m following the example on this link.

> **[Raspberry Pi Pico W | Connecting to the Internet - Tutorial Australia](https://core-electronics.com.au/guides/raspberry-pi-pico-w-connect-to-the-internet/)**
>
> IntroductionIn this guide, we'll get a Raspberry Pi Pico W connected to the internet using WiFi. To demonstrate the connection we can query a webpage, or get the current time from a time service. To follow along, all you'll need is:
> 
> A Raspberry Pi...

I believe I have the latest micro python build and I see this version when Thony starts up. Dated yesterday and it has the W shown.  
`MicroPython v1.19.1-728-g6503cd47a on 2022-12-06; Raspberry Pi Pico W with RP2040`

I have filled in my SSID and Password but the execution fails before it event gets to that line with the following error.

```auto
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
NameError: name 'network' isn't defined

```

I’ve tried Googling that error like a good little beginner but nothing useful comes up. To die on line 4 I’m obviously missing something fundamental.  
Any ideas?

Thanks  
David

---

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [7 December 2022 09:16 UTC](https://forum.core-electronics.com.au/t/pico-w-nameerror-name-network-isnt-defined/15832/2 "2022-12-07T09:16:10Z")

</div>

YEP Fundamental.

I missed the first few lines when doing the copy and paste  
Including the all important “import network”  
Maybe google will find this post for the next person 🙂

```auto
# A simple example that:
# - Connects to a WiFi Network defined by "ssid" and "password"
# - Performs a GET request (loads a webpage)
# - Queries the current time from a server

import network # handles connecting to WiFi

```

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [8 December 2022 00:05 UTC](https://forum.core-electronics.com.au/t/pico-w-nameerror-name-network-isnt-defined/15832/3 "2022-12-08T00:05:20Z")

</div>

Hi David,

Glad to hear you found the solution, and thanks for reporting back with your fix so others on the same path can benefit. 🙂

Earlier this week I was googling a problem with a hardware/firmware combination I was trying to fault find and only found two threads describing my exact problem that never got an update.🥲

All the best with the rest of your Pico W project!

---

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [8 December 2022 04:57 UTC](https://forum.core-electronics.com.au/t/pico-w-nameerror-name-network-isnt-defined/15832/4 "2022-12-08T04:57:57Z")

</div>

I once googled a very obscure technical problem and got a single hit and that was in Japanese.  
Google translated it into English (sort of) and I solved my problem.  
If my current project comes together I’ll try and do an article of how it works.
