vshymanskyy / blynk-library-python

Blynk library for Python. Works with Python 2, Python 3, MicroPython.
https://blynk.io/
MIT License
286 stars 98 forks source link

ImportError: No module named 'BlynkTimer' #34

Closed lucavallin closed 4 years ago

lucavallin commented 5 years ago

BlynkTimer seems to be broken somehow, cannot import it.

pi@raspberrypi:~/hytta $ python3 main.py
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ for Python v0.2.0 (Linux)

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    from BlynkTimer import BlynkTimer
ImportError: No module named 'BlynkTimer'
BradenM commented 5 years ago

Sorry about that! I forgot to add the module to setup.py.

Just opened a tiny PR to fix it.

lucavallin commented 5 years ago

Awesome, thanks!

vitormhenrique commented 5 years ago

I'm also having the same issue, any way to fix it?

BradenM commented 5 years ago

@vitormhenrique Seems that this repo is no longer being maintained. I would checkout lib-python, which is an actively maintained Blynk owned repo for python.

Otherwise, you can simply download the BlynkTimer.py file and upload it to your pyboard under /lib/BlynkTimer.py. There it will automatically be picked up by micropython and you can import it as so: from BlynkTimer import BlynkTimer

vitormhenrique commented 5 years ago

I actually was using the other library and got the same error! just realized that!

BradenM commented 5 years ago

@vitormhenrique Haha, can't blame you, there is a bit of confusion with two repos like this. On the other repo, the timer class is named Timer so it should be from blynktimer import Timer -- see here

If that doesn't fix your problem however, I would open an issue on lib-python.

vitormhenrique commented 5 years ago

Thanks!

I noticed that their setup.py does not include the blynktimer.

py_modules=['blynklib']

I already forked the repo and fixed.

Thanks for the help!

On Tue, Jun 25, 2019 at 9:57 PM Braden Mars notifications@github.com wrote:

@vitormhenrique https://github.com/vitormhenrique Haha, can't blame you, there is a bit of confusion with two repos like this. On the other repo, the timer class is named Timer so it should be from blynktimer import Timer -- see here https://github.com/blynkkk/lib-python/blob/master/TIMERS.md

if that doesn't fix your problem however, I would open an issue on (lib-python)[https://github.com/blynkkk/lib-python].

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vshymanskyy/blynk-library-python/issues/34?email_source=notifications&email_token=AA6ITF6YD6LBYICWNKNOIUTP4LLJXA5CNFSM4HBRVZ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYSFJGA#issuecomment-505697432, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6ITF3YXMYEAHMYU7YAEC3P4LLJXANCNFSM4HBRVZ2A .

shahidadnaan2000 commented 4 years ago

I got it fixed !!!!!!!!!

copy the BlynkLib in the same folder where your code is. It should fix the problem

link to down load the Blynklib: https://drive.google.com/open?id=177urVMTy9taL5ZN0XR7We0CrLr6_3sox

NOTE: This problem is happening because while installing bylnk by default python2 is used but for other application we are using python3 where the library is not getting copied.


This steps are for only new installed raspbian :

Suggested to follow : Step 1 : With the new install raspbian on PI Go to the link

https://learn.sparkfun.com/tutorials/python-programming-tutorial-getting-started-with-the-raspberry-pi/configure-your-pi

follow along from Use Python 3 Till the end

Step 2: install the blynk now and it should work


Still any issue please write to be directly at shahid.adnaan2000@gmail.com will help you ASAP(FREE).