Operating System: OS X 10.13.6
Python Version: 3.7
PyATV Version: 0.3.10
Native and Virtual environments: yes
I've been wrestling with this all day thinking I was doing something wrong (which I absolutely may be), but I'm at wits end. Home Assistant's dependency install of pyatv, virtual environment pip install, and native environment pip install yields the same error. I even tried it on another Mac that I had laying around it it gave me the exact same error.
When simply running atvremote (.bash_profile PATH set correctly), or using python3[.7] /path/to/atvremote the following is the only output:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/atvremote", line 7, in <module>
from pyatv.__main__ import main
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyatv/__init__.py", line 13, in <module>
from pyatv.internal.apple_tv import AppleTVInternal
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyatv/internal/apple_tv.py", line 363
run_async = asyncio.async # pylint: disable=no-member
^
SyntaxError: invalid syntax
Obviously the paths differ based on venv or native, but other than that it's the same.
When trying to use the appletv component of Home Assistant the following shows up in the log:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/homeassistant/components/apple_tv.py", line 115, in scan_for_apple_tvs
import pyatv
File "/Users/user/.homeassistant/deps/lib/python/site-packages/pyatv/__init__.py", line 13, in <module>
from pyatv.internal.apple_tv import AppleTVInternal
File "/Users/user/.homeassistant/deps/lib/python/site-packages/pyatv/internal/apple_tv.py", line 363
run_async = asyncio.async # pylint: disable=no-member
^
SyntaxError: invalid syntax
Clearly the same error. I've tried a lot of things to try and fix the problem, including reinstalling all dependencies manually at their required versions but the error persists.
Any help would be appreciated, even if it's to tell me I'm doing something painfully obvious incorrectly.
Thank you
Right, this happens because async and await are reserved keywords in python 3.7 (they were not in earlier versions). So the only work-around is to downgrade and use an older version of python. It should be possible to work-around this with getattr, I'll see if I can get a release out later tonight. Official python 3.7 support will not come until next major release, likely 0.4, so I just haven't tested this with 3.7.
@rephlex00 I didn't have time to fix this last week, but I definitely will tonight. Will also include fix for #150.
@rephlex00 This should be fixed in PR #154, please give it a try and let me know if it works. I will make a release to pypi afterwards.
Amazing. I鈥檒l try it this evening.
Any chance of this reaching a release so home assistant can get unbroken?
@marcusramberg Yes, sorry about the delay, I kinda got off track... I will try to shake up a release with fixes for a few issues now.
Release 0.3.11 is out and fixes this.
Thanks!