2024年11月24日星期日 下午4:53:28

Installing Home Assistant Core 2023.2.2 on Raspberry Pi 3B+ step by step

1 年 前
#20218 引用
1

(homeassistant20230200) homeassistant20230200@raspberrypi:/srv/homeassistant20230200 $ pip3 install pyOpenSSL --upgrade
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pyOpenSSL
  Using cached https://www.piwheels.org/simple/pyopenssl/pyOpenSSL-23.0.0-py3-none-any.whl (57 kB)
Requirement already satisfied: cryptography<40,>=38.0.0 in ./lib/python3.10/site-packages (from pyOpenSSL) (39.0.0)
Requirement already satisfied: cffi>=1.12 in ./lib/python3.10/site-packages (from cryptography<40,>=38.0.0->pyOpenSSL) (1.15.1)
Requirement already satisfied: pycparser in ./lib/python3.10/site-packages (from cffi>=1.12->cryptography<40,>=38.0.0->pyOpenSSL) (2.21)
Installing collected packages: pyOpenSSL
Successfully installed pyOpenSSL-23.0.0

0
1 年 前
#20219 引用

1
0
1 年 前
#20220 引用
https://github.com/home-assistant/core/blob/dev/requirements.txt

-c homeassistant/package_constraints.txt

# Home Assistant Core  2023.2.0
aiohttp==3.8.1
astral==2.2
async_timeout==4.0.2
attrs==22.2.0
atomicwrites-homeassistant==1.4.1
awesomeversion==22.9.0
bcrypt==4.0.1
certifi>=2021.5.30
ciso8601==2.3.0
httpx==0.23.3
home-assistant-bluetooth==1.9.2
ifaddr==0.1.7
jinja2==3.1.2
lru-dict==1.1.8
PyJWT==2.5.0
cryptography==39.0.0
pyOpenSSL==23.0.0
orjson==3.8.5
pip>=21.0,<22.4
python-slugify==4.0.1
pyyaml==6.0
requests==2.28.1
typing-extensions>=4.4.0,<5.0
voluptuous==0.13.1
voluptuous-serialize==2.5.0
yarl==1.8.1
0
1 年 前
#20221 引用


-c homeassistant/package_constraints.txt

# Home Assistant Core   2023.2.1
aiohttp==3.8.1
astral==2.2
async_timeout==4.0.2
attrs==22.2.0
atomicwrites-homeassistant==1.4.1
awesomeversion==22.9.0
bcrypt==4.0.1
certifi>=2021.5.30
ciso8601==2.3.0
httpx==0.23.3
home-assistant-bluetooth==1.9.2
ifaddr==0.1.7
jinja2==3.1.2
lru-dict==1.1.8
PyJWT==2.5.0
cryptography==39.0.0
pyOpenSSL==23.0.0
orjson==3.8.5
pip>=21.0,<23.1
python-slugify==4.0.1
pyyaml==6.0
requests==2.28.1
typing-extensions>=4.4.0,<5.0
voluptuous==0.13.1
voluptuous-serialize==2.5.0
yarl==1.8.1

0
1 年 前
#20223 引用


(homeassistant20230201) homeassistant20230201@raspberrypi:/srv/homeassistant20230201 $ pip3 install homeassistant==2023.2.1
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting homeassistant==2023.2.1
  Using cached homeassistant-2023.2.1-py3-none-any.whl (21.7 MB)
Collecting awesomeversion==22.9.0
  Using cached https://www.piwheels.org/simple/awesomeversion/awesomeversion-22.9.0-py3-none-any.whl (12 kB)
Collecting ciso8601==2.3.0
  Using cached ciso8601-2.3.0-cp310-cp310-linux_armv7l.whl
Collecting attrs==22.2.0
  Using cached https://www.piwheels.org/simple/attrs/attrs-22.2.0-py3-none-any.whl (60 kB)
Collecting pyyaml==6.0
  Using cached PyYAML-6.0-cp310-cp310-linux_armv7l.whl
Collecting yarl==1.8.1
  Using cached yarl-1.8.1-cp310-cp310-linux_armv7l.whl
Collecting home-assistant-bluetooth==1.9.2
  Using cached home_assistant_bluetooth-1.9.2-cp310-cp310-manylinux_2_31_armv7l.whl
Collecting pip<22.4,>=21.0
  Using cached pip-22.3.1-py3-none-any.whl (2.1 MB)
Collecting bcrypt==4.0.1
  Using cached bcrypt-4.0.1.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting lru-dict==1.1.8
  Using cached lru_dict-1.1.8-cp310-cp310-linux_armv7l.whl
Collecting orjson==3.8.5
  Using cached orjson-3.8.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (149 kB)
Collecting certifi>=2021.5.30
  Using cached https://www.piwheels.org/simple/certifi/certifi-2022.12.7-py3-none-any.whl (155 kB)
Requirement already satisfied: cryptography==39.0.0 in ./lib/python3.10/site-packages (from homeassistant==2023.2.1) (39.0.0)
Collecting aiohttp==3.8.1
  Using cached aiohttp-3.8.1-cp310-cp310-linux_armv7l.whl
Collecting async-timeout==4.0.2
  Using cached https://www.piwheels.org/simple/async-timeout/async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting voluptuous-serialize==2.5.0
  Using cached https://www.piwheels.org/simple/voluptuous-serialize/voluptuous_serialize-2.5.0-py3-none-any.whl (3.4 kB)
Collecting atomicwrites-homeassistant==1.4.1
  Using cached https://www.piwheels.org/simple/atomicwrites-homeassistant/atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB)
Collecting typing-extensions<5.0,>=4.4.0




0
1 年 前
#20224 引用


Using cached https://www.piwheels.org/simple/typing-extensions/typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting voluptuous==0.13.1
  Using cached https://www.piwheels.org/simple/voluptuous/voluptuous-0.13.1-py3-none-any.whl (35 kB)
Collecting python-slugify==4.0.1
  Using cached https://www.piwheels.org/simple/python-slugify/python_slugify-4.0.1-py2.py3-none-any.whl (7.0 kB)
Collecting pyOpenSSL==23.0.0
  Using cached https://www.piwheels.org/simple/pyopenssl/pyOpenSSL-23.0.0-py3-none-any.whl (57 kB)
Collecting astral==2.2
  Using cached https://www.piwheels.org/simple/astral/astral-2.2-py2.py3-none-any.whl (30 kB)
Collecting requests==2.28.1
  Using cached https://www.piwheels.org/simple/requests/requests-2.28.1-py3-none-any.whl (62 kB)
Collecting httpx==0.23.3
  Using cached https://www.piwheels.org/simple/httpx/httpx-0.23.3-py3-none-any.whl (71 kB)
Collecting PyJWT==2.5.0
  Using cached https://www.piwheels.org/simple/pyjwt/PyJWT-2.5.0-py3-none-any.whl (20 kB)
Collecting jinja2==3.1.2
  Using cached https://www.piwheels.org/simple/jinja2/Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting ifaddr==0.1.7
  Using cached https://www.piwheels.org/simple/ifaddr/ifaddr-0.1.7-py2.py3-none-any.whl (10 kB)
Collecting aiosignal>=1.1.2
  Using cached https://www.piwheels.org/simple/aiosignal/aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.3-cp310-cp310-linux_armv7l.whl



0
1 年 前
#20225 引用


Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.4-cp310-cp310-linux_armv7l.whl
Collecting charset-normalizer<3.0,>=2.0
  Using cached https://www.piwheels.org/simple/charset-normalizer/charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting pytz
  Using cached https://www.piwheels.org/simple/pytz/pytz-2022.7.1-py3-none-any.whl (499 kB)
Requirement already satisfied: cffi>=1.12 in ./lib/python3.10/site-packages (from cryptography==39.0.0->homeassistant==2023.2.1) (1.15.1)
Collecting rfc3986[idna2008]<2,>=1.3
  Using cached https://www.piwheels.org/simple/rfc3986/rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
Collecting httpcore<0.17.0,>=0.15.0
  Using cached https://www.piwheels.org/simple/httpcore/httpcore-0.16.3-py3-none-any.whl (69 kB)
Collecting sniffio
  Using cached https://www.piwheels.org/simple/sniffio/sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.2-cp310-cp310-linux_armv7l.whl
Collecting text-unidecode>=1.3
  Using cached https://www.piwheels.org/simple/text-unidecode/text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached https://www.piwheels.org/simple/urllib3/urllib3-1.26.14-py2.py3-none-any.whl (140 kB)
Collecting idna<4,>=2.5
  Using cached https://www.piwheels.org/simple/idna/idna-3.4-py3-none-any.whl (61 kB)
Requirement already satisfied: pycparser in ./lib/python3.10/site-packages (from cffi>=1.12->cryptography==39.0.0->homeassistant==2023.2.1) (2.21)
Collecting anyio<5.0,>=3.0
  Using cached https://www.piwheels.org/simple/anyio/anyio-3.6.2-py3-none-any.whl (80 kB)
Collecting h11<0.15,>=0.13
  Using cached https://www.piwheels.org/simple/h11/h11-0.14.0-py3-none-any.whl (58 kB)
Building wheels for collected packages: bcrypt
  Building wheel for bcrypt (pyproject.toml) ... done
  Created wheel for bcrypt: filename=bcrypt-4.0.1-cp310-cp310-linux_armv7l.whl size=608818 sha256=eb9ac7b030d5041608b0ca19c0753555397440fea338e75ec6a26f8cc0ae69bf
  Stored in directory: /home/homeassistant20230201/.cache/pip/wheels/db/db/c4/5fec7451b1fb200056c9141abba8a7d48c8399e5fa69484090
Successfully built bcrypt
Installing collected packages: voluptuous, text-unidecode, rfc3986, pytz, lru-dict, ifaddr, ciso8601, voluptuous-serialize, urllib3, typing-extensions, sniffio, pyyaml, python-slugify, PyJWT, pip, orjson, multidict, MarkupSafe, idna, home-assistant-bluetooth, h11, frozenlist, charset-normalizer, certifi, bcrypt, awesomeversion, attrs, atomicwrites-homeassistant, async-timeout, astral, yarl, requests, jinja2, anyio, aiosignal, pyOpenSSL, httpcore, aiohttp, httpx, homeassistant
  Attempting uninstall: pip
    Found existing installation: pip 23.0
    Uninstalling pip-23.0:
      Successfully uninstalled pip-23.0
Successfully installed MarkupSafe-2.1.2 PyJWT-2.5.0 aiohttp-3.8.1 aiosignal-1.3.1 anyio-3.6.2 astral-2.2 async-timeout-4.0.2 atomicwrites-homeassistant-1.4.1 attrs-22.2.0 awesomeversion-22.9.0 bcrypt-4.0.1 certifi-2022.12.7 charset-normalizer-2.1.1 ciso8601-2.3.0 frozenlist-1.3.3 h11-0.14.0 home-assistant-bluetooth-1.9.2 homeassistant-2023.2.1 httpcore-0.16.3 httpx-0.23.3 idna-3.4 ifaddr-0.1.7 jinja2-3.1.2 lru-dict-1.1.8 multidict-6.0.4 orjson-3.8.5 pip-22.3.1 pyOpenSSL-23.0.0 python-slugify-4.0.1 pytz-2022.7.1 pyyaml-6.0 requests-2.28.1 rfc3986-1.5.0 sniffio-1.3.0 text-unidecode-1.3 typing-extensions-4.4.0 urllib3-1.26.14 voluptuous-0.13.1 voluptuous-serialize-2.5.0 yarl-1.8.1



0
1 年 前
#20226 引用

2023-02-05 00:30:47.251 INFO (SyncWorker_2) [homeassistant.util.package] Attempting install of pillow==9.4.0


python中pillow是什么意思_python pillow是什么

PIL:Python Imaging Library,已经是Python平台事实上的图像处理标准库了。PIL功能非常强大,但API却非常简单易用。



由于PIL仅支持到Python 2.7,加上年久失修,于是一群志愿者在PIL的基础上创建了兼容的版本,名字叫Pillow,支持最新Python 3.x,又加入了许多新特性,因此,我们可以直接安装使用Pillow。

安装Pillow

如果安装了Anaconda,Pillow就已经可用了。否则,需要在命令行下通过pip安装:$ pip install pillow

操作图像

来看看最常见的图像缩放操作,只需三四行代码:from PIL import Image

# 打开一个jpg图像文件,注意是当前路径:

im = Image.open('test.jpg')

# 获得图像尺寸:

w, h = im.size

print('Original image size: %sx%s' % (w, h))

# 缩放到50%:

im.thumbnail((w//2, h//2))

print('Resize image to: %sx%s' % (w//2, h//2))

# 把缩放后的图像用jpeg格式保存
0
1 年 前
#20227 引用
解决python3.9安装pillow库出错问题

https://blog.csdn.net/lhfde/article/details/114768598

pip install pillow==8.0 -i https://pypi.tuna.tsinghua.edu.cn/simple


https://pillow.readthedocs.io/en/latest/installation.html
0
1 年 前
#20234 引用
No module named '_sqlite3

The Problem

解决Python3 No module named '_sqlite3'错误

升级完python3.10.9以及新安装home assistant core 2023.2.2后运行 hass -v项目的时候出现 No module named '_sqlite3' 错误:

2023-02-06 06:20:39.968 ERROR (MainThread) [homeassistant.setup] Setup failed for analytics: Unable to import component: No module named '_sqlite3'



reason

When you compiled Python you did so with some required system libraries missing.

debug

root@raspberrypi:~# python3
Python 3.10.9 (main, Jan 18 2023, 18:50:28) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/local/lib/python310.zip', '/usr/local/lib/python3.10', '/usr/local/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/site-packages']
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.10/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.10/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'



root@raspberrypi:~# find / -name _sqlite*.so
/snap/core/14402/usr/lib/python3.5/lib-dynload/_sqlite3.cpython-35m-arm-linux-gnueabihf.so
/snap/core/14449/usr/lib/python3.5/lib-dynload/_sqlite3.cpython-35m-arm-linux-gnueabihf.so
/snap/core18/2683/usr/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-arm-linux-gnueabihf.so
/snap/core18/2670/usr/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-arm-linux-gnueabihf.so
find: ‘/proc/8481’: 没有那个文件或目录
/usr/lib/pypy/lib_pypy/_sqlite3_cffi.pypy-73-arm-linux-gnueabihf.so
/usr/lib/python2.7/lib-dynload/_sqlite3.arm-linux-gnueabihf.so
/usr/lib/python3.9/lib-dynload/_sqlite3.cpython-39-arm-linux-gnueabihf.so



0