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

Windows Error #5

Open
frakman1 opened this issue Oct 2, 2015 · 5 comments
Open

Windows Error #5

frakman1 opened this issue Oct 2, 2015 · 5 comments

Comments

@frakman1
Copy link

frakman1 commented Oct 2, 2015

Although I was able to run this easily on my Mac, I couldn't get it to work on Windows. At first, I got an error about no module named 'bitstruct' but I got around that with pip install bitstruct. Now I get this error:

C:\Python27\python-lifx-sdk-master\python-lifx-sdk-master\examples>python fraktest.py
Traceback (most recent call last):
  File "fraktest.py", line 1, in <module>
    import lifx
  File "c:\python27\lib\site-packages\lifx\__init__.py", line 1, in <module>
    from client import Client
  File "c:\python27\lib\site-packages\lifx\client.py", line 7, in <module>
    import device
  File "c:\python27\lib\site-packages\lifx\device.py", line 5, in <module>
    from lifx.color import modify_color
ImportError: No module named color

Any ideas what might be going wrong? This is on a Windows 7 machine:
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32

Incidentally, the test script looks like this:

import lifx

lights = lifx.Client()
time.sleep(1)
for l in lights.get_devices():
    print "Toggle %s" % l.label
    l.power_toggle()
@smarthall
Copy link
Owner

Interesting ... python can find the lifx package but not the color module. Do you have a conflicting installation of another LIFX supporting python module?

@frakman1
Copy link
Author

I have lifxlan, lifx, lifx-python and lazylights (all from github I believe)

Do you think it's due to lifx? I got that from here: https://github.com/pHaeusler/lifx

@abowman
Copy link

abowman commented Mar 15, 2016

Same issue, different module. It installed fine using python setup.py install. When I try to run one of examples scripts, I get this:

Traceback (most recent call last):
  File "lifx.py", line 6, in <module>
    import lifx.Client
  File "c:\Users\abowman\Dropbox\bin\lifx.py", line 6, in <module>
    import lifx.Client
ImportError: No module named Client

If I print the sys.path, it looks like this:

print "\n".join(sys.path)
C:\Python27\lib\site-packages\setuptools-2.0-py2.7.egg
C:\Python27\lib\site-packages\lifx_sdk-0.8-py2.7.egg
C:\Python27\lib\site-packages\bitstruct-1.0.0-py2.7.egg
C:\Windows\system32\python27.zip
C:\Python27\DLLs
C:\Python27\lib
C:\Python27\lib\plat-win
C:\Python27\lib\lib-tk
C:\Python27
C:\Python27\lib\site-packages
>>>

@abowman
Copy link

abowman commented Mar 15, 2016

The discovery example works if I open the python console and paste the script in, but it won't run if I run the script from a file. This has me confused.

@frakman1
Copy link
Author

frakman1 commented Dec 8, 2016

I was able to get around this using virtual environments for windows. See this page for instructions on how to set one up.

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