Hi, I was using HA 0.90.1 in a venv with Python 3.5,3 (the latest built for Raspbian) but decided to upgrade Python into a replacement venv following Python 3.6 upgrade of a virtualenv. With Python 3.7 being reasonably mature now, I used the 3.7.3 source and built as per those instructions with a couple of minor additions (sudo apt install libffi-dev and make -j4 ). Whilst doing this I also upgraded HA to 0.90.2.
Now when I start up I get the following error, which results in no Zigbee devices working in my configuration.
Error setting up entry /dev/ttyAMA0 for zha
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 302, in async_setup
result = await component.async_setup_entry(hass, self)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/zha/__init__.py", line 109, in async_setup_entry
import zhaquirks # noqa
File "/srv/homeassistant/lib/python3.7/site-packages/zhaquirks/__init__.py", line 66, in <module>
importlib.import_module(modname)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/srv/homeassistant/lib/python3.7/site-packages/zhaquirks/xiaomi/aqara/cube_aqgl01.py", line 7, in <module>
from zigpy.quirks.xiaomi import AqaraMagicCubeSensor
ImportError: cannot import name 'AqaraMagicCubeSensor' from 'zigpy.quirks.xiaomi' (/srv/homeassistant/lib/python3.7/site-packages/zigpy/quirks/xiaomi/__init__.py)
A couple of similar looking issues here are this and that, but the suggested solutions were to use a virtual environment, which I already am.
This suggests just blowing away the old venv and populating the new one by simply installing the latest version of HA, which will automatically pull in all the python dependencies it needs, and at the correct versions.
That worked much better, I no longer get the errors, and my ZHA devices are back
Iām having this same problem. I followed the instructions you provided and no luck. By default, it seems that āpip3 install homeassistantā doesnāt install zigpy - and once I install zigpy, I start getting the error you pasted above āImportError: cannot import name āAqaraMagicCubeSensorā from āzigpy.quirks.xiaomiā (/srv/homeassistant/lib/python3.7/site-packages/zigpy/quirks/xiaomi/init.py)ā
Normally the python requirements would be installed by pip, and then the first thing hass does when you run it manually is to download any extras required by your config. I have just reviewed the instruction I linked above, and realised that there was one step I missed outā¦
After stopping the service you need to remove or rename the folder containing the old venv. So that would be ā¦
# first ensure the service is stopped for the upgrade
sudo systemctl stop home-assistant@homeassistant
# save the old environment
sudo mv /srv/homeassistant{,.`date +%y%m%d`}
# permission a folder for the new one
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
# back in the user context set up the new venv
sudo -u homeassistant -H -s
now continue as per the link. Please let me know if that helps, and I will update the article.
@artmg - I was deleted the old venv, so I donāt think thatās it. If I follow the steps you provided, I get a āno version availableā error and a ātimeoutā error. Then I install zigpy and zigpy-deconz and I get the error you got above āImportError: cannot import name āAqaraMagicCubeSensorāā¦ā.
Iām wondering if thereās another package that hass isnāt catching that I need to install manuallyā¦
@beatsWorking I am pretty sure that I did this on a clean Raspbian lite image, and only needed sudo apt install -y python3 python3-venv python3-pip as system dependencies, and that the python and hass modules all came down with the instructions shown. At one point I did have python3 -m pip install wheel in there too, but I have since blown away that venv and all worked fine on later attempts.
So just to understand where these errors occurā¦ āno version availableā happens when you ā¦ ? And where does the timeout happen. Perhaps if you could paste the command lines you use and a sample of the terminal output immediately before the errors, it may help to diagnose. Also, please specify which exact versions of python3 and homeassistant are being pulled down.
Oh, and actually there is one other thing I noticed - you are using zigpy-deconz, whereas I have been using zha - I wonder if there is not a bug or breaking change in zigpy that the zha developer has fixed, but that has not yet been addressed in deconz? Anyhow, if you first start with the diags I mention above, then that will help understand exactly where this error is arising. Thanks.