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

'module' object has no attribute 'TM1637' #9

Closed
AlexUhde opened this issue Aug 28, 2018 · 5 comments
Closed

'module' object has no attribute 'TM1637' #9

AlexUhde opened this issue Aug 28, 2018 · 5 comments

Comments

@AlexUhde
Copy link

Hello,
I'm trying to use your code on a WEMOS D1 with MicroPython 1.9.4.
I can run the "import" commands for both, the tm1637 and the machine, but when I run the tm line, it fails with the following error:

import tm1637
from machine import Pin
tm = tm1637.TM1637(clk=Pin(5), dio=Pin(4))
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'TM1637'

Could you please let me know on how to fix this?

Kind regards,
Alex

@mcauser
Copy link
Owner

mcauser commented Aug 28, 2018

Sounds like it may not have copied across successfully. Try putting tm1637.py on the board again and reset. Are you using ampy, rshell?

Alternatively, add it to your /modules folder and a frozen version will be compiled and added to your build.

@AlexUhde
Copy link
Author

Hi,
I used ampy to copy it over.
I removed it and copied it again, after downloading it from here, but I'm still getting the same error.
I will try a different board and adding to modules later.

@mbrada
Copy link

mbrada commented Aug 30, 2018

Make sure you have downloaded the code itself and NOT the complete HTML page with code. I had the same issue and then I recognize, that despite of .py suffix, the file was HTML page.

@AlexUhde
Copy link
Author

Hi all,
I downloaded the zip file, so it was the real python file.
I reset the Wemos D1 (erase and re-uploaded esp8266-20180511-v1.9.4.bin).
Only uploaded the tm1637.py
Now it works. not sure what caused it to fail, but after a reload it works.
Thank you all.

Kind regards,
Alex

@AlexUhde
Copy link
Author

Issue is fixed now

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