本帖最后由 showphi 于 2020-11-9 11:11 编辑
最近又提醒需要升级python,
Python version
Support for the running Python version 3.7.3 is deprecated and will be removed in the first release after December 7, 2020. Please upgrade Python to 3.8.0 or higher.
复制代码
自己升级了下怎么都不成功,花了不少时间终于找到正确方法,给大家分享下。可以升级到3.8-3.9任意版本。
1. 先关掉HA
sudo systemctl stop [email protected]
2.更新
sudo apt-get update && sudo apt-get upgrade -y
3. 安装依赖包
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev python3 python3-dev python3-venv python3-pip libffi-dev libtiff-dev autoconf libopenjp2-7 python3-pip libglib2.0-dev
4. 执行python3.8的升级(一行一条命令)
wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz
tar xzvf Python-3.8.6.tgz
cd Python-3.8.6
./configure
sudo make altinstall
sudo apt -y autoremove
cd
sudo rm -r Python-3.8.6
sudo rm Python-3.8.6.tgz
sudo mv /srv/homeassistant /srv/homeassistant_old
cd /srv
sudo mkdir homeassistant
sudo chown homeassistant:homeassistant homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
/usr/local/bin/python3.8 -m venv .
source bin/activate
python3 -m pip install wheel
pip3 install homeassistant
pip3 install websocket-client #(用sonoff的安装)
pip3 install mysqlclient #(用mysql的安装)
5.最后查一下是否升级好了
复制代码