请选择 进入手机版 | 继续访问电脑版

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

 找回密码
 立即注册
查看: 3005|回复: 8

K3梅林TB版如何降级python3

[复制链接]

10

主题

68

帖子

570

积分

高级会员

Rank: 4

积分
570
金钱
502
HASS币
0
发表于 2019-2-17 15:00:28 | 显示全部楼层 |阅读模式
    K3梅林TB版装python3现在版本为python3.7。装HASS报错。。
   用python3 -m pip install homeassistant
  报错
        c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
       #include <ffi.h>
                       ^
      compilation terminated.
      error: command 'arm-openwrt-linux-gnueabi-gcc' failed with exit status 1

      ----------------------------------------
  Command "/opt/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/opt/tmp/pip-install-5l89fssv/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/opt/tmp/pip-record-00j36_xv/install-record.txt --single-version-externally-managed --prefix /tmp/opt/tmp/pip-build-env-w5_2e1t9/overlay --compile" failed with error code 1 in /tmp/opt/tmp/pip-install-5l89fssv/cffi/

  ----------------------------------------
Command "/opt/bin/python3 /opt/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/opt/tmp/pip-build-env-w5_2e1t9/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel "cffi>=1.1; python_implementation != 'PyPy'"" failed with error code 1 in None

  用pip3 install homeassistant
  报错
        c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
       #include <ffi.h>
                       ^
      compilation terminated.
      error: command 'arm-openwrt-linux-gnueabi-gcc' failed with exit status 1

      ----------------------------------------
  Command "/opt/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/opt/tmp/pip-install-13fmpsyk/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/opt/tmp/pip-record-n1sp6ct_/install-record.txt --single-version-externally-managed --prefix /tmp/opt/tmp/pip-build-env-q1m3ihvj/overlay --compile" failed with error code 1 in /tmp/opt/tmp/pip-install-13fmpsyk/cffi/

  ----------------------------------------
Command "/opt/bin/python3.7 /opt/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/opt/tmp/pip-build-env-q1m3ihvj/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel "cffi>=1.1; python_implementation != 'PyPy'"" failed with error code 1 in None

是不是python3版本的问题还是那个东西装掉了。
想将python3降级为3.6看看如装得起不。
请高手解答。

回复

使用道具 举报

1

主题

172

帖子

2138

积分

金牌会员

Rank: 6Rank: 6

积分
2138
金钱
1966
HASS币
0
发表于 2019-2-18 11:38:35 | 显示全部楼层
不建议用entware安装的python3,再安装hass

会出现各种问题,也不能换mysql或pgsql数据库

你这里是没有 arm-openwrt-linux-gnueabi-gcc,不能编译 cffi,换python3.6是没用的
回复

使用道具 举报

10

主题

68

帖子

570

积分

高级会员

Rank: 4

积分
570
金钱
502
HASS币
0
 楼主| 发表于 2019-2-18 12:51:18 | 显示全部楼层
本帖最后由 colock 于 2019-2-18 14:59 编辑
MattSmell 发表于 2019-2-18 11:38
不建议用entware安装的python3,再安装hass

会出现各种问题,也不能换mysql或pgsql数据库

gcc以经安装好了啊。。admin@RT-AC3100-4A2C:/lib# arm-openwrt-linux-gnueabi-
arm-openwrt-linux-gnueabi-c++        arm-openwrt-linux-gnueabi-gcc-6.3.0
arm-openwrt-linux-gnueabi-g++        arm-openwrt-linux-gnueabi-gcc-ar
arm-openwrt-linux-gnueabi-gcc

装了这么多

回复

使用道具 举报

1

主题

172

帖子

2138

积分

金牌会员

Rank: 6Rank: 6

积分
2138
金钱
1966
HASS币
0
发表于 2019-2-18 15:26:28 | 显示全部楼层
你还需要这个 https://github.com/Entware/Entwa ... -native-compilation
总之,很麻烦
回复

使用道具 举报

10

主题

68

帖子

570

积分

高级会员

Rank: 4

积分
570
金钱
502
HASS币
0
 楼主| 发表于 2019-2-23 18:32:37 | 显示全部楼层
本帖最后由 colock 于 2019-2-23 18:33 编辑

能仔细说说吗?我照到上面的做了还是不行。。报下面的错误
admin@RT-AC3100-4A2C:/tmp/home/root# pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/p ... y2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 2.4MB/s
Installing collected packages: pip
  Found existing installation: pip 19.0.2
    Uninstalling pip-19.0.2:
      Successfully uninstalled pip-19.0.2
Successfully installed pip-19.0.3
admin@RT-AC3100-4A2C:/tmp/home/root# python3 -m pip install homeassistant
Collecting homeassistant
  Using cached https://files.pythonhosted.org/p ... .1-py3-none-any.whl
Collecting cryptography==2.5 (from homeassistant)
  Downloading https://files.pythonhosted.org/p ... tography-2.5.tar.gz (487kB)
    100% |████████████████████████████████| 491kB 3.0MB/s
  Installing build dependencies ... error
  Complete output from command /opt/bin/python3 /opt/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-02gi4mbb/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.8,!=1.11.3; python_implementation != 'PyPy'":
  Collecting setuptools>=18.5
    Using cached https://files.pythonhosted.org/p ... y2.py3-none-any.whl
  Collecting wheel
    Using cached https://files.pythonhosted.org/p ... y2.py3-none-any.whl
  Collecting cffi!=1.11.3,>=1.8
    Using cached https://files.pythonhosted.org/p ... /cffi-1.12.1.tar.gz
  Collecting pycparser (from cffi!=1.11.3,>=1.8)
    Using cached https://files.pythonhosted.org/p ... cparser-2.19.tar.gz
  Installing collected packages: setuptools, wheel, pycparser, cffi
    Running setup.py install for pycparser: started
      Running setup.py install for pycparser: finished with status 'done'
    Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      Complete output from command /opt/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-v7x81ce5/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-zbjk6dkc/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-02gi4mbb/overlay --compile:
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.7
      creating build/lib.linux-armv7l-3.7/cffi
      copying cffi/recompiler.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/verifier.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/__init__.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/lock.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/api.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/cparser.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/error.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/commontypes.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/model.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/_embedding.h -> build/lib.linux-armv7l-3.7/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.7/cffi
      warning: build_py: byte-compiling is disabled, skipping.

      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-armv7l-3.7
      creating build/temp.linux-armv7l-3.7/c
      arm-openwrt-linux-gnueabi-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -DNDEBUG -fno-inline -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft -DNDEBUG -fno-inline -I/media/ware3/Entware.2018.12/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/include -I/media/ware3/Entware.2018.12/staging_dir/toolchain-arm_cortex-a9_gcc-7.3.0_glibc-2.23_eabi/include -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/opt/include/python3.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.7/c/_cffi_backend.o
      arm-openwrt-linux-gnueabi-gcc -shared -L/media/ware3/Entware.2018.12/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link=/media/ware3/Entware.2018.12/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/media/ware3/Entware.2018.12/staging_dir/toolchain-arm_cortex-a9_gcc-7.3.0_glibc-2.23_eabi/lib -L/media/ware3/Entware.2018.12/build_dir/target-arm_cortex-a9_glibc-2.23_eabi/Python-3.7.1 -L/media/ware3/Entware.2018.12/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link=/media/ware3/Entware.2018.12/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/media/ware3/Entware.2018.12/staging_dir/toolchain-arm_cortex-a9_gcc-7.3.0_glibc-2.23_eabi/lib -L/media/ware3/Entware.2018.12/build_dir/target-arm_cortex-a9_glibc-2.23_eabi/Python-3.7.1 build/temp.linux-armv7l-3.7/c/_cffi_backend.o -L/opt/lib -lffi -lpython3.7 -o build/lib.linux-armv7l-3.7/_cffi_backend.cpython-37.so
      /opt/bin/ld: cannot find -lffi
      collect2: error: ld returned 1 exit status
      error: command 'arm-openwrt-linux-gnueabi-gcc' failed with exit status 1

      ----------------------------------------
  Command "/opt/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-v7x81ce5/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-zbjk6dkc/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-02gi4mbb/overlay --compile" failed with error code 1 in /tmp/pip-install-v7x81ce5/cffi/

  ----------------------------------------
Command "/opt/bin/python3 /opt/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-02gi4mbb/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.8,!=1.11.3; python_implementation != 'PyPy'"" failed with error code 1 in None


回复

使用道具 举报

1

主题

172

帖子

2138

积分

金牌会员

Rank: 6Rank: 6

积分
2138
金钱
1966
HASS币
0
发表于 2019-2-23 18:54:53 | 显示全部楼层
不说了,不推荐这种方法,就是这个坎过去了,后面也是问题多多
回复

使用道具 举报

10

主题

68

帖子

570

积分

高级会员

Rank: 4

积分
570
金钱
502
HASS币
0
 楼主| 发表于 2019-2-23 19:13:28 | 显示全部楼层
MattSmell 发表于 2019-2-23 18:54
不说了,不推荐这种方法,就是这个坎过去了,后面也是问题多多

一直都是这个问题啊。。大神帮个忙吧
回复

使用道具 举报

0

主题

28

帖子

69

积分

注册会员

Rank: 2

积分
69
金钱
41
HASS币
0
发表于 2019-5-25 13:15:18 | 显示全部楼层
学习学习
回复

使用道具 举报

0

主题

10

帖子

31

积分

新手上路

Rank: 1

积分
31
金钱
21
HASS币
0
发表于 2019-12-14 10:42:35 | 显示全部楼层
谢谢分享!学习学习
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-3-29 14:32 , Processed in 0.585066 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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