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

 找回密码
 立即注册
查看: 3350|回复: 3

[技术探讨] 【已解决】python-miio 安装的求教。

[复制链接]

5

主题

17

帖子

60

积分

注册会员

Rank: 2

积分
60
金钱
43
HASS币
0
发表于 2020-2-29 17:59:48 | 显示全部楼层 |阅读模式
本帖最后由 pagani 于 2020-2-29 19:05 编辑

请问在win10环境是否可以安装miio 0.4.8?
已经安装了home assistant,可正常运行。
然后操作是否应该在命令行下输入
pip install python-miio

pip3 install python-miio

目前安装遇到错误,不知应如何解决。
提示如下:
pip install python-miio
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting python-miio
  Using cached https://mirrors.aliyun.com/pypi/ ... .8-py3-none-any.whl (174 kB)
Requirement already satisfied: construct in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2.10.56)
Requirement already satisfied: click>=7 in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (7.0)
Collecting netifaces
  Using cached https://mirrors.aliyun.com/pypi/ ... faces-0.10.9.tar.gz (28 kB)
Requirement already satisfied: appdirs in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (1.4.3)
Requirement already satisfied: pytz in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2019.3)
Requirement already satisfied: attrs in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (19.3.0)
Requirement already satisfied: zeroconf in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (0.24.4)
Requirement already satisfied: cryptography in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2.8)
Requirement already satisfied: tqdm in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (4.43.0)
Requirement already satisfied: ifaddr in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from zeroconf->python-miio) (0.1.6)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from cryptography->python-miio) (1.14.0)
Requirement already satisfied: six>=1.4.1 in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from cryptography->python-miio) (1.14.0)
Requirement already satisfied: pycparser in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography->python-miio) (2.19)
Installing collected packages: netifaces, python-miio
    Running setup.py install for netifaces ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\pagan\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-om73knl8\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-om73knl8\\netifaces\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pagan\AppData\Local\Temp\pip-record-txem83qx\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\pagan\appdata\local\programs\python\python38-32\Include\netifaces'
         cwd: C:\Users\pagan\AppData\Local\Temp\pip-install-om73knl8\netifaces\
    Complete output (11 lines):
    running install
    running build
    running build_ext
    building 'netifaces' extension
    creating build
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -DNETIFACES_VERSION=0.10.9 -Ic:\users\pagan\appdata\local\programs\python\python38-32\include -Ic:\users\pagan\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" /Tcnetifaces.c /Fobuild\temp.win32-3.8\Release\netifaces.obj
    netifaces.c
    c:\users\pagan\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\pagan\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-om73knl8\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-om73knl8\\netifaces\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pagan\AppData\Local\Temp\pip-record-txem83qx\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\pagan\appdata\local\programs\python\python38-32\Include\netifaces' Check the logs for full command output.



求教各位了,谢谢!
回复

使用道具 举报

73

主题

1165

帖子

6643

积分

论坛元老

Rank: 8Rank: 8

积分
6643
金钱
5473
HASS币
30
发表于 2020-2-29 18:08:44 | 显示全部楼层
pip3 install python-miio -i https://pypi.douban.com/simple

换个源试试
回复

使用道具 举报

5

主题

17

帖子

60

积分

注册会员

Rank: 2

积分
60
金钱
43
HASS币
0
 楼主| 发表于 2020-2-29 18:15:12 | 显示全部楼层
pip3 install python-miio -i https://pypi.douban.com/simple
Looking in indexes: https://pypi.douban.com/simple
Collecting python-miio
  Downloading https://pypi.doubanio.com/packag ... .8-py3-none-any.whl (174 kB)
     |████████████████████████████████| 174 kB 6.4 MB/s
Requirement already satisfied: cryptography in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2.8)
Requirement already satisfied: zeroconf in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (0.24.4)
Requirement already satisfied: click>=7 in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (7.0)
Requirement already satisfied: tqdm in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (4.43.0)
Requirement already satisfied: attrs in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (19.3.0)
Requirement already satisfied: appdirs in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (1.4.3)
Requirement already satisfied: construct in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2.10.56)
Requirement already satisfied: pytz in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2019.3)
Collecting netifaces
  Downloading https://pypi.doubanio.com/packag ... faces-0.10.9.tar.gz (28 kB)
Requirement already satisfied: six>=1.4.1 in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from cryptography->python-miio) (1.14.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from cryptography->python-miio) (1.14.0)
Requirement already satisfied: ifaddr in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from zeroconf->python-miio) (0.1.6)
Requirement already satisfied: pycparser in c:\users\pagan\appdata\local\programs\python\python38-32\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography->python-miio) (2.19)
Installing collected packages: netifaces, python-miio
    Running setup.py install for netifaces ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\pagan\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-cmtklhv0\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-cmtklhv0\\netifaces\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pagan\AppData\Local\Temp\pip-record-t9u1w4rk\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\pagan\appdata\local\programs\python\python38-32\Include\netifaces'
         cwd: C:\Users\pagan\AppData\Local\Temp\pip-install-cmtklhv0\netifaces\
    Complete output (11 lines):
    running install
    running build
    running build_ext
    building 'netifaces' extension
    creating build
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -DNETIFACES_VERSION=0.10.9 -Ic:\users\pagan\appdata\local\programs\python\python38-32\include -Ic:\users\pagan\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include" /Tcnetifaces.c /Fobuild\temp.win32-3.8\Release\netifaces.obj
    netifaces.c
    c:\users\pagan\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\pagan\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-cmtklhv0\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\pagan\\AppData\\Local\\Temp\\pip-install-cmtklhv0\\netifaces\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pagan\AppData\Local\Temp\pip-record-t9u1w4rk\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\pagan\appdata\local\programs\python\python38-32\Include\netifaces' Check the logs for full command output.

貌似一样哦
回复

使用道具 举报

5

主题

17

帖子

60

积分

注册会员

Rank: 2

积分
60
金钱
43
HASS币
0
 楼主| 发表于 2020-2-29 18:37:14 | 显示全部楼层
已解决。
Netifaces少库文件。
https://www.lfd.uci.edu/~gohlke/pythonlibs/对应版本下载,pip安装后,再安装miio即可。
我安装了netifaces‑0.10.9‑cp38‑cp38‑win32.whl.whl.
感谢qq群里的【观音】89240125
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 21:37 , Processed in 0.111386 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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