『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 6024|回复: 4

[求助] 安卓手机安装HomeAssistant后运行报错cannot import name '_imaging' f...

[复制链接]

4

主题

18

帖子

118

积分

注册会员

Rank: 2

积分
118
金钱
100
HASS币
0
发表于 2021-6-21 23:54:23 | 显示全部楼层 |阅读模式
硬件:荣耀7X (BND-AL10 EMUI9.1.0   安卓版本 9)
手机未root
软件环境:
手机安装 Termux  0.114
termux下安装 homeassistant
大略安装步骤
启动termux→更新软件→安装openssh→设置密码后Xshell连接→apt 安装python(3.9.5)→pip 安装virtualenv→建立并进入虚拟环境→pip 安装homeassistant→安装成功后 hass→ 报错提示需要Pillow8.1.2→pip在线安装失败→下载whl文件离线安装成功→hass→还是报错
报错如下
(homeassistant) ~ $ hass
2021-06-21 23:14:46 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //data/data/com.termux/files/home/.homeassistant/home-assistant_v2.db was shutdown cleanly
2021-06-21 23:14:46 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=2 from 2021-06-21 15:11:06.330333)
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Setup failed for image: Unable to import component: cannot import name '_imaging' from 'PIL' (/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/PIL/__init__.py)
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of person. Setup failed for dependencies: image
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Setup failed for person: Could not set up all dependencies.
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: person
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: onboarding
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of my. Setup failed for dependencies: frontend
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Setup failed for my: Could not set up all dependencies.
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: frontend
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of map. Setup failed for dependencies: frontend
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Setup failed for map: Could not set up all dependencies.
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of mobile_app. Setup failed for dependencies: person
2021-06-21 23:14:49 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: Could not set up all dependencies.
2021-06-21 23:15:55 ERROR (MainThread) [homeassistant.setup] Setup failed for dhcp: unknown error
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 200, in _async_setup_component
    component = integration.get_component()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 490, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/data/data/com.termux/files/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/homeassistant/components/dhcp/__init__.py", line 17, in <module>
    from scapy.arch.common import compile_filter
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/__init__.py", line 135, in <module>
    _set_conf_sockets()  # Apply config
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/config.py", line 618, in _set_conf_sockets
    conf.ifaces.reload()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/interfaces.py", line 238, in reload
    self._reload_provs()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/interfaces.py", line 234, in _reload_provs
    self._load(prov.reload(), prov)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/interfaces.py", line 53, in reload
    return self.load()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/linux.py", line 420, in load
    get_if_raw_hwaddr(i, siocgifhwaddr=SIOCGIFHWADDR)[1]
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/common.py", line 87, in get_if_raw_hwaddr
    get_if(iff, siocgifhwaddr)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/common.py", line 65, in get_if
    return ioctl(sck, cmd, struct.pack("16s16x", iff.encode("utf8")))
PermissionError: [Errno 13] Permission denied
2021-06-21 23:16:04 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: zeroconf
2021-06-21 23:16:52 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: dhcp, frontend, logbook, map, mobile_app, my, person
2021-06-21 23:16:52 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.
2021-06-21 23:16:52 WARNING (MainThread) [homeassistant.bootstrap] Detected that frontend did not load. Activating safe mode
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Setup failed for image: Unable to import component: cannot import name '_imaging' from 'PIL' (/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/PIL/__init__.py)
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of person. Setup failed for dependencies: image
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Setup failed for person: Could not set up all dependencies.
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: person
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: onboarding
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend
2021-06-21 23:16:53 ERROR (MainThread) [homeassistant.setup] Setup failed for safe_mode: Could not set up all dependencies.
^C(homeassistant) ~ $ ^C
(homeassistant) ~ $ from PIL import _imaging
No command from found, did you mean:
 Command frob in package frobtads
(homeassistant) ~ $ hass
2021-06-21 23:30:03 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //data/data/com.termux/files/home/.homeassistant/home-assistant_v2.db was shutdown cleanly
2021-06-21 23:30:03 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=3 from 2021-06-21 15:14:46.378579)
2021-06-21 23:30:04 ERROR (MainThread) [homeassistant.setup] Setup failed for image: Unable to import component: cannot import name '_imaging' from 'PIL' (/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/PIL/__init__.py)
2021-06-21 23:30:04 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of person. Setup failed for dependencies: image
2021-06-21 23:30:04 ERROR (MainThread) [homeassistant.setup] Setup failed for person: Could not set up all dependencies.
2021-06-21 23:30:04 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: person
2021-06-21 23:30:04 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
2021-06-21 23:30:04 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: onboarding
2021-06-21 23:30:04 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2021-06-21 23:30:07 ERROR (MainThread) [homeassistant.setup] Setup failed for dhcp: unknown error
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 200, in _async_setup_component
    component = integration.get_component()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 490, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/data/data/com.termux/files/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/homeassistant/components/dhcp/__init__.py", line 17, in <module>
    from scapy.arch.common import compile_filter
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/__init__.py", line 135, in <module>
    _set_conf_sockets()  # Apply config
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/config.py", line 618, in _set_conf_sockets
    conf.ifaces.reload()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/interfaces.py", line 238, in reload
    self._reload_provs()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/interfaces.py", line 234, in _reload_provs
    self._load(prov.reload(), prov)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/interfaces.py", line 53, in reload
    return self.load()
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/linux.py", line 420, in load
    get_if_raw_hwaddr(i, siocgifhwaddr=SIOCGIFHWADDR)[1]
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/common.py", line 87, in get_if_raw_hwaddr
    get_if(iff, siocgifhwaddr)
  File "/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/scapy/arch/common.py", line 65, in get_if
    return ioctl(sck, cmd, struct.pack("16s16x", iff.encode("utf8")))
PermissionError: [Errno 13] Permission denied
2021-06-21 23:30:07 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: frontend
2021-06-21 23:30:07 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.
2021-06-21 23:30:07 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of my. Setup failed for dependencies: frontend
2021-06-21 23:30:07 ERROR (MainThread) [homeassistant.setup] Setup failed for my: Could not set up all dependencies.
2021-06-21 23:30:07 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of map. Setup failed for dependencies: frontend
2021-06-21 23:30:07 ERROR (MainThread) [homeassistant.setup] Setup failed for map: Could not set up all dependencies.
2021-06-21 23:30:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of mobile_app. Setup failed for dependencies: person
2021-06-21 23:30:08 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: Could not set up all dependencies.
2021-06-21 23:30:08 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: dhcp, frontend, logbook, map, mobile_app, my, person
2021-06-21 23:30:08 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.
2021-06-21 23:30:08 WARNING (MainThread) [homeassistant.bootstrap] Detected that frontend did not load. Activating safe mode
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Setup failed for image: Unable to import component: cannot import name '_imaging' from 'PIL' (/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/PIL/__init__.py)
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of person. Setup failed for dependencies: image
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Setup failed for person: Could not set up all dependencies.
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: person
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: onboarding
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend
2021-06-21 23:30:09 ERROR (MainThread) [homeassistant.setup] Setup failed for safe_mode: Could not set up all dependencies.
^C(homeassistant) ~ $ ^C
我的理解是由于第一个报错导致后面的都无法进行下去
(homeassistant) ~ $ hass
2021-06-21 23:14:46 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //data/data/com.termux/files/home/.homeassistant/home-assistant_v2.db was shutdown cleanly
2021-06-21 23:14:46 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=2 from 2021-06-21 15:11:06.330333)
2021-06-21 23:14:47 ERROR (MainThread) [homeassistant.setup] Setup failed for image: Unable to import component: cannot import name '_imaging' from 'PIL' (/data/data/com.termux/files/home/homeassistant/lib/python3.9/site-packages/PIL/__init__.py)
cannot import name '_imaging' from 'PIL'
搜索很久都没有找到解决方案,希望大神能够解答。拜谢!!
回复

使用道具 举报

4

主题

18

帖子

118

积分

注册会员

Rank: 2

积分
118
金钱
100
HASS币
0
 楼主| 发表于 2021-6-22 21:55:47 | 显示全部楼层
本帖最后由 csphhing 于 2021-6-25 00:34 编辑

东摸西索算是解决了报错,手机应用管理,清除termux软件存储内容后,
启动termux→更新软件→安装openssh→设置密码后Xshell连接→apt 安装python(3.9.5)→pip 安装homeassistant→安装成功后 hass→ 报错提示需要Pillow8.1.2→pip在线安装失败→还是报错
如下(部分)  
~ $ pip install pillow==8.1.2
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Collecting pillow==8.1.2
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/60/f0/dd2eb7911f948bf529f58f0c7931f6f6466f711bd6f1d81a69dc4edd4e2a/Pillow-8.1.2.tar.gz (45.2 MB)
     |████████████████████████████████| 45.2 MB 3.1 MB/s 
Using legacy 'setup.py install' for pillow, since package 'wheel' is not installed.
Installing collected packages: pillow
    Running setup.py install for pillow ... error
    ERROR: Command errored out with exit status 1:
     command: /data/data/com.termux/files/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/com.termux/files/usr/tmp/pip-install-x_m1lg8s/pillow_b121068ed5574a77a604e927e0a5e23a/setup.py'"'"'; __file__='"'"'/data/data/com.termux/files/usr/tmp/pip-install-x_m1lg8s/pillow_b121068ed5574a77a604e927e0a5e23a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-_7tolwbg/install-record.txt --single-version-externally-managed --compile --install-headers /data/data/com.termux/files/usr/include/python3.9/pillow
         cwd: /data/data/com.termux/files/usr/tmp/pip-install-x_m1lg8s/pillow_b121068ed5574a77a604e927e0a5e23a/

解决如下:
~ $ apt install libjpeg-turbo
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libjpeg-turbo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 279 kB of archives.
After this operation, 1421 kB of additional disk space will be used.
Get:1 https://packages.termux.org/apt/termux-main stable/main aarch64 libjpeg-turbo aarch64 2.1.0 [279 kB]
Fetched 279 kB in 3s (109 kB/s)        
Selecting previously unselected package libjpeg-turbo.
(Reading database ... 12958 files and directories currently installed.)
Preparing to unpack .../libjpeg-turbo_2.1.0_aarch64.deb ...
Unpacking libjpeg-turbo (2.1.0) ...
Setting up libjpeg-turbo (2.1.0) ...
~ $ pip install pillow==8.1.2
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Collecting pillow==8.1.2
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/60/f0/dd2eb7911f948bf529f58f0c7931f6f6466f711bd6f1d81a69dc4edd4e2a/Pillow-8.1.2.tar.gz (45.2 MB)
     |████████████████████████████████| 45.2 MB 1.5 MB/s 
Using legacy 'setup.py install' for pillow, since package 'wheel' is not installed.
Installing collected packages: pillow
    Running setup.py install for pillow ... done
Successfully installed pillow-8.1.2




回复

使用道具 举报

0

主题

7

帖子

52

积分

注册会员

Rank: 2

积分
52
金钱
45
HASS币
0
发表于 2021-6-22 22:23:06 | 显示全部楼层
我安装完后,注册成功,但设置位置时一直报错,不知道为啥,题主遇到了没?
2021-06-22 21:59:41 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [500572089312] Error handling message: Invalid time zone passed in. Valid options can be found here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones for dictionary value @ data['time_zone']. Got 'America/Denver'
2021-06-22 21:59:52 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [500572089312] Error handling message: Invalid time zone passed in. Valid options can be found here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones for dictionary value @ data['time_zone']. Got 'Asia/Shanghai'
回复

使用道具 举报

4

主题

18

帖子

118

积分

注册会员

Rank: 2

积分
118
金钱
100
HASS币
0
 楼主| 发表于 2021-6-23 09:55:35 | 显示全部楼层
homemaster 发表于 2021-6-22 22:23
我安装完后,注册成功,但设置位置时一直报错,不知道为啥,题主遇到了没?
2021-06-22 21:59:41 ERROR (Ma ...

我也有这个报错,问题不在网页上看,要看后台报错代码:Unable to set up dependencies of default_config
但我也不知道怎么解决。
回复

使用道具 举报

0

主题

6

帖子

358

积分

中级会员

Rank: 3Rank: 3

积分
358
金钱
352
HASS币
0
发表于 2021-6-29 09:36:48 | 显示全部楼层
在6月初升級到6.2板就出現這個問題了,到官方論壇反映也沒得到回覆...希望重版友們可以一起去官方討論區反映
https://community.home-assistant ... sistant-core/307942
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 13:45 , Processed in 0.137230 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表