joaquincasares / python-wifi-leds

A cross-vendor Python library for WiFi LED products.
27 stars 20 forks source link

error running script #5

Open avenantsoftware opened 9 years ago

avenantsoftware commented 9 years ago

I have this python script:

!/usr/bin/env python

import wifileds

led_connection = wifileds.limitlessled.connect('192.168.2.10', 8899)

led_connection.rgbw.zone_on(1)

wich gives this error:

AttributeError: 'module' object has no attribute 'limitlessled'

Am I misisng something in the above code?

joaquincasares commented 9 years ago

That should have worked:

https://github.com/joaquincasares/python-wifi-leds/blob/master/tests/limitlessled.py#L128

How did you install the package? Try cloning the repo and placing your sample file in the root directory and try again. Perhaps I messed up in the actual packaging process.

avenantsoftware commented 9 years ago

I installed the python module as instructed:

pip install wifileds

etc...

when i run from terminal: locate wifileds

the files are installed because it returns:

/usr/local/lib/python2.7/dist-packages/wifileds /usr/local/lib/python2.7/dist-packages/wifileds-1.0.6.egg-info /usr/local/lib/python2.7/dist-packages/wifileds/init.py /usr/local/lib/python2.7/dist-packages/wifileds/init.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/README.md /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/init.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/init.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/bridge.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/bridge.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/rgb.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/rgb.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/rgbw.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/rgbw.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/white.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/white.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/init.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/init.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/colorful_strobe.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/colorful_strobe.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/fade_down.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/fade_down.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/fade_up.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/fade_up.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/police_flashers.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/police_flashers.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/pulsating_swells.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/pulsating_swells.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/rainbow_fade.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/rainbow_fade.pyc /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/strobe.py /usr/local/lib/python2.7/dist-packages/wifileds/limitlessled/effects/strobe.pyc /usr/local/lib/python2.7/dist-packages/wifileds-1.0.6.egg-info/PKG-INFO /usr/local/lib/python2.7/dist-packages/wifileds-1.0.6.egg-info/SOURCES.txt /usr/local/lib/python2.7/dist-packages/wifileds-1.0.6.egg-info/dependency_links.txt /usr/local/lib/python2.7/dist-packages/wifileds-1.0.6.egg-info/installed-files.txt /usr/local/lib/python2.7/dist-packages/wifileds-1.0.6.egg-info/top_level.txt

joaquincasares commented 9 years ago

What's the exact stacktrace you get when you try to run your code?

Also, did running it in the folder work?

avenantsoftware commented 9 years ago

Traceback (most recent call last): File "wifileds.py", line 2, in import wifileds File "/home/htpc/Hue/wifileds.py", line 4, in led_connection = wifileds.limitlessled.connect('192.168.2.10', 8899) AttributeError: 'module' object has no attribute 'limitlessled'

if the module was not installed correctly, python would give more errors, it only has a problem with the limitlessled part in the code, as if it was not defined

what do you mean by running it from the folder? do there have to be more files in the folder I run the script from, besides that the module is installed?

joaquincasares commented 9 years ago

In the meantime, try cloning this repo and running your sample script from the repo's root directory. Let me know if that works for you please.

avenantsoftware commented 9 years ago

yeah that works

TheGitLife commented 9 years ago

Hey Guys - I am facing the same issue as spambus got above: 'module' object has no attribute 'limitlessled'

How did you guys fixed it? Also, what do you mean by running the sample script from repo's root directory? I tried running tests\limitless.py from multiple locations, and it always seem to fail.