Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aziascreations opened this issue Feb 25, 2021 · 4 comments

Comments

@aziascreations
Copy link

aziascreations commented Feb 25, 2021

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 ?

@ladyada
Copy link
Member

ladyada commented Feb 27, 2021

yeah it probably isnt working on micropython due to pretty much nobody using it outside of linux. wanna try patching/fixing the library to see if it can be re-worked for micropython?

@ghost
Copy link

ghost commented Feb 28, 2021

I've also got the exact same issue.
I'll try and have a look at it.
In the meantime do you know if previous versions also have this issue?

@ladyada
Copy link
Member

ladyada commented Feb 28, 2021

its probably been broken for a long time :D

@makermelissa
Copy link
Contributor

Fixed via #161

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants