AppleTV error in 0.49

Noob here. This is what helped me:

sudo apt-get install build-essential libssl-dev libffi-dev python-dev
sudo pip3 install --upgrade pyatv