2018-08-21 19:34:11 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform workday
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/binary_sensor/workday.py", line 73, in setup_platform
obj_holidays = getattr(holidays, country)(years=year)
AttributeError: module 'holidays' has no attribute 'US'
I had it without the quotes, and then added the quotes. I reverted to the version of workday.py from 75.3 and it works. Not sure why though, it was a little beyond my skillset.
it doesnβt look like HA is the problem. The only significant lines in the file point to the resource that the workday component uses, which isnβt maintained by home assistant.
I had used US for the past several months without issue. Iβve already changed the workday.py to the previous version from a couple weeks ago according to the check in date. That works without any change to my sensor. I will try to convert back to the updated version of the workday.py that is native to 76.x and report back.
Yeah, I understand, but for some reason the resource that is being used does not contain the US attribute. The US can be specified in 2 ways, US or UnitedStates. It could be a bug in the resource library with the US attribute.
The only changes in workday.py is the version of the holidays module went from 0.9.5 to 0.9.6, and a few more countries were allowed in the platform config (because they were added in the holidays module.) And both US and UnitedStates classes are in both 0.9.5 and 0.9.6. So, you shouldnβt be getting this error. Sounds like something messed up in your install.
I agree, I looked closely and could not find anything at all either (other than the addition of India). Butβ¦ replacing 0.9.6 with .0.9.5 did βfixβ my issue. With that said, maybe the 0.9.6 was corrupt or something during the install. I will definitely try putting it back as it was and see if I have any issues.
Updated again, and once again it stopped working, here is what I see in the logs
``
2018-09-07 21:49:46 ERROR (SyncWorker_16) [homeassistant.util.package] Unable to install package holidays==0.9.6: Exception:
Traceback (most recent call last):
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/basecommand.pyβ, line 141, in main
status = self.run(options, args)
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/commands/install.pyβ, line 299, in run
resolver.resolve(requirement_set)
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/resolve.pyβ, line 102, in resolve
self._resolve_one(requirement_set, req)
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/resolve.pyβ, line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/resolve.pyβ, line 209, in _get_abstract_dist_for
self.require_hashes
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/operations/prepare.pyβ, line 283, in prepare_linked_requirement
progress_bar=self.progress_bar
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/download.pyβ, line 823, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/download.pyβ, line 728, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/utils/misc.pyβ, line 578, in unpack_file
flatten=not filename.endswith(β.whlβ)
File β/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/utils/misc.pyβ, line 463, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File β/usr/lib/python3.6/zipfile.pyβ, line 1108, in init
self._RealGetContents()
File β/usr/lib/python3.6/zipfile.pyβ, line 1175, in _RealGetContents
raise BadZipFile(βFile is not a zip fileβ)
zipfile.BadZipFile: File is not a zip file
2018-09-07 21:49:46 ERROR (MainThread) [homeassistant.requirements] Not initializing binary_sensor.workday because could not install requirement holidays==0.9.6
2018-09-07 21:49:46 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform binary_sensor.workday: Could not install all requirements.