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

Cannot import name 'SymmetricMapping' #18

Closed
t871631092 opened this issue Mar 9, 2018 · 14 comments
Closed

Cannot import name 'SymmetricMapping' #18

t871631092 opened this issue Mar 9, 2018 · 14 comments

Comments

@t871631092
Copy link

2018-03-09 14:57:14 ERROR (Thread-19) [custom_components.light.yeelight_bt] Got exception: cannot import name 'SymmetricMapping'
2018-03-09 14:57:14 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: source=custom_components/light/yeelight_bt.py, exception=, level=ERROR, timestamp=1520607434.851715, message=Got exception: cannot import name 'SymmetricMapping'>

I can‘t find the SymmetricMapping by anyway,I'm crazy

@hcoohb
Copy link

hcoohb commented Mar 12, 2018

I have the same error.
Is it because of construct 2.9.37 ? (which is upgraded if you do an upgrade from git)

@t871631092
Copy link
Author

I have installed the 2.9.25 Should i upgrade ?

@cwt0490
Copy link

cwt0490 commented Mar 13, 2018

#17

this should explain why.

what i did is just call
pip install construct==2.9.25

which is downgrade to 2.9.25

@t871631092
Copy link
Author

it work on my first time run hass --open-ui
then the second time i run
it error again

@hcoohb
Copy link

hcoohb commented Apr 3, 2018

Construct is now pinned at 2.9.41 on home assistant.

But yeelightbt is still showing the same error.
(And the code from the Pull Request 16 is not working either)
Anyone could point us in the right direction ?

@olskar
Copy link

olskar commented May 1, 2018

I have the same issue

@frittes
Copy link

frittes commented Jun 9, 2018

Any chance to solve this issue in the near future?

@DanAE111
Copy link

Same for me. Even if you downgrade if you're using home assistant this will break other components.

@arekbulski
Copy link

In some recent Construct version, SymmetricMapping was renamed to Mapping. This error is caused by using an outdated version.

@rytilahti
Copy link
Owner

The fix is being worked in #19, but it's a bit slow process as I'm busy with other things currently. If someone wants to step up and finish that porting, it'd be more than welcome.

@onlyyou
Copy link

onlyyou commented Nov 11, 2018

hey,
did make commande
pip install construct==2.9.25
but still have error
pi@raspberrypi:~ $ yeelightbt scan
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 "/home/pi/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 484, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/pi/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2725, in load_entry_point
return ep.load()
File "/home/pi/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2343, in load
return self.resolve()
File "/home/pi/.local/lib/python3.5/site-packages/pkg_resources/init.py", line 2349, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/pi/.local/lib/python3.5/site-packages/yeelightbt/init.py", line 2, in
from .lamp import Lamp
File "/home/pi/.local/lib/python3.5/site-packages/yeelightbt/lamp.py", line 7, in
from .structures import Request, Response, StateResult
File "/home/pi/.local/lib/python3.5/site-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'

thanks

@lasry1
Copy link

lasry1 commented Feb 11, 2019

I have the same problem, i've installed the plugin with custom deps deployment (i'm running Hassio with HA 0.87.0) but i can't make the light available...

@Thieum64
Copy link

Hi,
It seems to be a good script to control Candela but I'm facing the same issue 'ImportError: cannot import name 'SymmetricMapping' when trying to install it.
Is there a way to workarround ?
Thanks

@rytilahti
Copy link
Owner

rytilahti commented Feb 26, 2019

So I just merged the changes and the code is where I left it long time ago. The basic functionality should work by using the command line tool for what it's worth, maybe someone finds this useful and creates PRs to fix other issues (esp. the homeassistant parts require work to make it usable), I have no personal interest on working further on this.

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