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

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

[求助] 安装pip3 install python-miio时报错 求解决啊

[复制链接]

14

主题

85

帖子

911

积分

高级会员

Rank: 4

积分
911
金钱
826
HASS币
0
发表于 2017-9-23 01:53:03 | 显示全部楼层 |阅读模式
pip3 install python-miio
Collecting python-miio
Collecting click (from python-miio)
  Using cached click-6.7-py2.py3-none-any.whl
Collecting cryptography (from python-miio)
  Using cached cryptography-2.0.3.tar.gz
Collecting construct (from python-miio)
Collecting idna>=2.1 (from cryptography->python-miio)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography->python-miio)
  Using cached asn1crypto-0.22.0-py2.py3-none-any.whl
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography->python-miio)
Collecting cffi>=1.7 (from cryptography->python-miio)
  Using cached cffi-1.11.0.tar.gz
Collecting pycparser (from cffi>=1.7->cryptography->python-miio)
Building wheels for collected packages: cryptography, cffi
  Running setup.py bdist_wheel for cryptography ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-o69qqpr9/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpefgtnscrpip-wheel- --python-tag cp34:
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
   #include <ffi.h>
                   ^
  compilation terminated.
  Traceback (most recent call last):
    File "/usr/lib/python3.4/distutils/unixccompiler.py", line 116, in _compile
      extra_postargs)
    File "/usr/lib/python3.4/distutils/ccompiler.py", line 909, in spawn
      spawn(cmd, dry_run=self.dry_run)
    File "/usr/lib/python3.4/distutils/spawn.py", line 36, in spawn
      _spawn_posix(cmd, search_path, dry_run=dry_run)
    File "/usr/lib/python3.4/distutils/spawn.py", line 162, in _spawn_posix
      % (cmd, exit_status))
  distutils.errors.DistutilsExecError: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 161, in run
      cmd = self.call_command('install_lib', warn_dir=0)
    File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 147, in call_command
      self.run_command(cmdname)
    File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 22, in run
      self.build()
    File "/usr/lib/python3.4/distutils/command/install_lib.py", line 109, in build
      self.run_command('build_ext')
    File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 54, in run
      _build_ext.run(self)
    File "/usr/lib/python3.4/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/usr/lib/python3.4/distutils/command/build_ext.py", line 448, in build_extensions
      self.build_extension(ext)
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 187, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/lib/python3.4/distutils/command/build_ext.py", line 503, in build_extension
      depends=ext.depends)
    File "/usr/lib/python3.4/distutils/ccompiler.py", line 574, in compile
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/usr/lib/python3.4/distutils/unixccompiler.py", line 118, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1063, in run_setup
      run_setup(setup_script, args)
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 68, in run_setup
      DirectorySandbox(setup_dir).run(runner)
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 114, in run
      return func()
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 67, in runner
      _execfile(setup_script, ns)
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 43, in _execfile
      exec(code, globals, locals)
    File "/tmp/easy_install-6o67bcdg/cffi-1.11.0/setup.py", line 235, in <module>

    File "/usr/lib/python3.4/distutils/core.py", line 163, in setup
      raise SystemExit("error: " + str(msg))
  SystemExit: error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-o69qqpr9/cryptography/setup.py", line 312, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 262, in __init__
      self.fetch_build_eggs(attrs['setup_requires'])
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs
      replace_conflicting=True,
    File "/usr/lib/python3/dist-packages/pkg_resources.py", line 631, in resolve
      dist = best[req.key] = env.best_match(req, ws, installer)
    File "/usr/lib/python3/dist-packages/pkg_resources.py", line 874, in best_match
      return self.obtain(req, installer)
    File "/usr/lib/python3/dist-packages/pkg_resources.py", line 886, in obtain
      return installer(requirement)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 338, in fetch_build_egg
      return cmd.easy_install(req)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 636, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 666, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 856, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1078, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1066, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py clean for cryptography
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-o69qqpr9/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
   #include <ffi.h>
                   ^
  compilation terminated.
  Traceback (most recent call last):
    File "/usr/lib/python3.4/distutils/unixccompiler.py", line 116, in _compile
      extra_postargs)
    File "/usr/lib/python3.4/distutils/ccompiler.py", line 909, in spawn
      spawn(cmd, dry_run=self.dry_run)
    File "/usr/lib/python3.4/distutils/spawn.py", line 36, in spawn
      _spawn_posix(cmd, search_path, dry_run=dry_run)
    File "/usr/lib/python3.4/distutils/spawn.py", line 162, in _spawn_posix
      % (cmd, exit_status))
  distutils.errors.DistutilsExecError: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 161, in run
      cmd = self.call_command('install_lib', warn_dir=0)
    File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 147, in call_command
      self.run_command(cmdname)
    File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 22, in run
      self.build()
    File "/usr/lib/python3.4/distutils/command/install_lib.py", line 109, in build
      self.run_command('build_ext')
    File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 54, in run
      _build_ext.run(self)
    File "/usr/lib/python3.4/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/usr/lib/python3.4/distutils/command/build_ext.py", line 448, in build_extensions
      self.build_extension(ext)
    File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 187, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/lib/python3.4/distutils/command/build_ext.py", line 503, in build_extension
      depends=ext.depends)
    File "/usr/lib/python3.4/distutils/ccompiler.py", line 574, in compile
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/usr/lib/python3.4/distutils/unixccompiler.py", line 118, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1063, in run_setup
      run_setup(setup_script, args)
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 68, in run_setup
      DirectorySandbox(setup_dir).run(runner)
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 114, in run
      return func()
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 67, in runner
      _execfile(setup_script, ns)
    File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 43, in _execfile
      exec(code, globals, locals)
    File "/tmp/easy_install-rt1oq7os/cffi-1.11.0/setup.py", line 235, in <module>

    File "/usr/lib/python3.4/distutils/core.py", line 163, in setup
      raise SystemExit("error: " + str(msg))
  SystemExit: error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-o69qqpr9/cryptography/setup.py", line 312, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 262, in __init__
      self.fetch_build_eggs(attrs['setup_requires'])
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs
      replace_conflicting=True,
    File "/usr/lib/python3/dist-packages/pkg_resources.py", line 631, in resolve
      dist = best[req.key] = env.best_match(req, ws, installer)
    File "/usr/lib/python3/dist-packages/pkg_resources.py", line 874, in best_match
      return self.obtain(req, installer)
    File "/usr/lib/python3/dist-packages/pkg_resources.py", line 886, in obtain
      return installer(requirement)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 338, in fetch_build_egg
      return cmd.easy_install(req)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 636, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 666, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 856, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1078, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1066, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  ----------------------------------------
  Failed cleaning build dir for cryptography
  Running setup.py bdist_wheel for cffi ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-o69qqpr9/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmptxha9a_mpip-wheel- --python-tag cp34:
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.4
  creating build/lib.linux-armv7l-3.4/cffi
  copying cffi/recompiler.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/commontypes.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/model.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/api.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/verifier.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/lock.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/cparser.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/error.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/__init__.py -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/_embedding.h -> build/lib.linux-armv7l-3.4/cffi
  copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.4/cffi
  running build_ext
  building '_cffi_backend' extension
  creating build/temp.linux-armv7l-3.4
  creating build/temp.linux-armv7l-3.4/c
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.4m -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.4/c/_cffi_backend.o
  c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
   #include <ffi.h>
                   ^
  compilation terminated.
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cffi
  Running setup.py clean for cffi
Failed to build cryptography cffi
Installing collected packages: click, idna, asn1crypto, pycparser, cffi, cryptography, construct, python-miio
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/usr/local/lib/python3.4/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/click'

回复

使用道具 举报

18

主题

142

帖子

2582

积分

金牌会员

Rank: 6Rank: 6

积分
2582
金钱
2440
HASS币
0

论坛风云人物

发表于 2017-9-30 01:54:31 | 显示全部楼层
权限问题
回复

使用道具 举报

220

主题

1284

帖子

7859

积分

超级版主

Rank: 8Rank: 8

积分
7859
金钱
6545
HASS币
86

教程狂人论坛风云人物突出贡献

发表于 2017-10-1 16:26:58 来自手机 | 显示全部楼层
hssbian要进入虚拟环境安装
回复

使用道具 举报

5

主题

85

帖子

1323

积分

金牌会员

Rank: 6Rank: 6

积分
1323
金钱
1238
HASS币
0
发表于 2017-10-1 18:52:10 来自手机 | 显示全部楼层
哈哈,你不在虚拟环境安装,就能成功
回复

使用道具 举报

0

主题

41

帖子

273

积分

中级会员

Rank: 3Rank: 3

积分
273
金钱
232
HASS币
0
发表于 2017-12-5 13:56:35 | 显示全部楼层
我再docker容易里安装也出现这种问题
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-29 09:58 , Processed in 0.228612 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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