Skip to content

AttributeError: 'module' object has no attribute 'environ' on MicroPython and an ESP32 #144

Closed
@aziascreations

Description

@aziascreations

Hello,

I was trying to replicate one of the examples from the "adafruit/Adafruit_CircuitPython_SHTC3" repository in the REPL, but when I imported the "busio" module I got an error from the adafruit_platformdetect/chip.py file which returned this traceback:

  File "<stdin>", line 1, in <module>
  File "/lib/busio.py", line 17, in <module>
  File "/lib/adafruit_blinka/agnostic/__init__.py", line 18, in <module>
  File "/lib/adafruit_platformdetect/chip.py", line 69, in id
AttributeError: 'module' object has no attribute 'environ'

It seems like it comes from the line number 69 in that file where the script tries to access the os.environ attribute, which also doesn't appear when I list them:

>>> import os
>>> dir(os)
['__class__', '__name__', 'remove', 'VfsFat', 'VfsLfs2', 'chdir', 'dupterm', 'dupterm_notify', 'getcwd', 'ilistdir', 'listdir', 'mkdir', 'mount', 'rename', 'rmdir', 'stat', 'statvfs', 'umount', 'uname', 'urandom']

I'm currently using the "ASDelivery ESP32 NodeMCU" with an ESP32-WROOM-32 on it which is running the prebuilt firmware from the official website named esp32-idf4-20210202-v1.14.bin.

And the modules I installed are the following:

  • adafruit-circuitpython-bundle-py-20210225 (partially)
  • Adafruit_Blinka-6.2.2
  • Adafruit_Python_PlatformDetect-3.1.1
  • Adafruit_Python_PureIO-1.1.8

Is this normal or is it a bug, I haven't seen any mention of this error anywhere ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions