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

Issues (different) on both PY2.7 and PY3.5 #17

Closed
Bob2345de opened this issue Feb 22, 2018 · 5 comments
Closed

Issues (different) on both PY2.7 and PY3.5 #17

Bob2345de opened this issue Feb 22, 2018 · 5 comments

Comments

@Bob2345de
Copy link

Bob2345de commented Feb 22, 2018

Install seems successful but error as follows installed on Python2.7.9:
@raspberrypi:~ export YEELIGHTBT_MAC=F8:24:41:C0:36:AF
@raspberrypi:~ yeelightbt

Traceback (most recent call last):
File "/usr/local/bin/yeelightbt", line 11, in
load_entry_point('python-yeelightbt==0.0.3.1', 'console_scripts', 'yeelightbt')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2631, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2291, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2297, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/yeelightbt/init.py", line 2, in
from .lamp import Lamp
File "/usr/local/lib/python2.7/dist-packages/yeelightbt/lamp.py", line 192
def set_temperature(self, kelvin: int, brightness: int):
^
SyntaxError: invalid syntax (caret is under the : after Kelvin)

And on PY3.5:
@raspberrypi:~ export YEELIGHTBT_MAC=F8:24:41:C0:36:AF
@raspberrypi:~ yeelightbt --help
Traceback (most recent call last):
File "/usr/local/bin/yeelightbt", line 11, in
load_entry_point('python-yeelightbt==0.0.3.1', 'console_scripts', 'yeelightbt')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2631, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2291, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2297, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.5/dist-packages/yeelightbt/init.py", line 2, in
from .lamp import Lamp
File "/usr/local/lib/python3.5/dist-packages/yeelightbt/lamp.py", line 7, in
from .structures import Request, Response, StateResult
File "/usr/local/lib/python3.5/dist-packages/yeelightbt/structures.py", line 4, in
from construct import (Struct, Int8ub, Int16ub, Const, Padded, Byte, Enum, Bytes, If, FlagsEnum,
ImportError: cannot import name 'SymmetricMapping'

Thank you!!

@Bob2345de
Copy link
Author

Bob2345de commented Feb 22, 2018

Found the issue. There were some changes made to "construct" as described here: construct/construct#642

Overwriting the constructs directory with the contents from an older version 2.9.25 (available here https://github.com/construct/construct/releases/tag/v2.9.25 ) solved the issue on Python3.5, it now works!

I suspect that some changes will need to be made to yeelightbt to keep it compatible going forward.

Thanks

@rytilahti
Copy link
Owner

The construct's API is currently unstable, but this issue will probably be fixed by PR #16. Btw, you should use pip to install the packages instead of manually copying files over, so pip install construct==2.9.25 should work :-)

@matteos1
Copy link

python-yeelightbt requires Python '>=3.4' but the running Python is 2.7.13 not work install

@arekbulski
Copy link

arekbulski commented Jul 21, 2018

Construct has achieved what you would call a "stable API". Well, almost stable: the issue described in the PR (EmbeddedSwitch) remains unresolved. But otherwise, its stable. :)

@rytilahti
Copy link
Owner

👍 I will close this issue, this project does not support python 2, and the symmetricmapping problem is tracked in #18.

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

4 participants