• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Newbie Question NameError 'os' not defined

Q&A Forum › Category: ESP32 › Newbie Question NameError 'os' not defined
0 Vote Up Vote Down
Harold asked 4 months ago

Hello everyone,
I’m just doing my first steps with ESP32. I loaded and ran the micropython ESP32 DHT11 tutorial using uPyCraft 1.1 and everything worked fine …. once. So I tried to change the format of the numbers from f3.1 to f3.2 in main.py and got:
os.listdir(‘.’)
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
NameError: name ‘os’ isn’t defined
>>>
reflush tree false
Changing back to the original file using ctrl Z did not help. 
Adding import sys in boot.py did not help.
Any ideas where this is coming from and how to fix it?

Question Tags: NameError os
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 months ago

Hi.
I’m  not sure what may have caused the issue… but, I recommend uploading the firmware to the ESP32 and start again with your code.

 

Alternatively, I recommend using Thonny IDE instead. I think it’s easier to use.

Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.