Python >=3.5.3 on Synology

hi thy1225,
my wheel files won’t work for you, because I have a different architecture.

point 3 and 4 look good. (I don’t know if the toolchain can handle incremental make, so to be on the safe side call make clean before calling make with your architecture again.

point 5:
after successful build you should find a spk file in folder /spksrc/packages. It is actually an archive you can open for example with 7-zip. Then open the archives inside the archive until you find a folder share/wheelhouse. Here you should find several whl files. Extract and copy cffi to your synology. Install the whl file with pip: pip install cffiXXX.whl.

Hi yogi1200,

“Solved it!! XD I wrote down what I did in the next reply”

Thanks for explaining~ I finished the point 5! :slight_smile:
but I still got error installing the latest home assistant (0.80.3)
it does have some error message but I cannot figure out how to solve it.
something like these:

Building wheels for collected packages: bcrypt, cryptography
Running setup.py bdist_wheel for bcrypt … error

Exception: Version mismatch: this is the ‘cffi’ package version 1.11.5, located in ‘/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py’. When we import the top-level ‘_cffi_backend’ extension module, we get version 1.11.2, located in ‘/volume1/@appstore/python3/lib/python3.5/site-packages/_cffi_backend.cpython-35m-arm-linux-gnueabi.so’. The two versions should be equal; check your installation.

Failed building wheel for bcrypt

and a lot of other errors…

Do you think you can take a look for me?
Thank you very much~
the full log is down here:

root@tM-Cloud:/volume1/@appstore/python3/bin# ./python3 -m pip install --upgrade homeassistant
Collecting homeassistant
  Using cached https://files.pythonhosted.org/packages/c0/d5/1c17e38a185fc2ee95ef17c410760c2766cef09899ace54815d164013f12/homeassistant-0.80.3-py3-none-any.whl
Collecting pip>=8.0.3 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Collecting aiohttp==3.4.4 (from homeassistant)
Requirement already up-to-date: pyyaml<4,>=3.13 in /volume1/@appstore/python3/lib/python3.5/site-packages (from homeassistant)
Collecting voluptuous-serialize==2.0.0 (from homeassistant)
Collecting attrs==18.2.0 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Requirement already up-to-date: PyJWT==1.6.4 in /volume1/@appstore/python3/lib/python3.5/site-packages (from homeassistant)
Collecting async-timeout==3.0.0 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/96/0f/e6357458c87fb4ed8f3df215773f3caad40968f10e05552cbd8bd28415e4/async_timeout-3.0.0-py3-none-any.whl
Requirement already up-to-date: voluptuous==0.11.5 in /volume1/@appstore/python3/lib/python3.5/site-packages (from homeassistant)
Requirement already up-to-date: jinja2>=2.10 in /volume1/@appstore/python3/lib/python3.5/site-packages (from homeassistant)
Collecting bcrypt==3.1.4 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/f3/ec/bb6b384b5134fd881b91b6aa3a88ccddaad0103857760711a5ab8c799358/bcrypt-3.1.4.tar.gz
Collecting cryptography==2.3.1 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/22/21/233e38f74188db94e8451ef6385754a98f3cad9b59bedf3a8e8b14988be4/cryptography-2.3.1.tar.gz
Requirement already up-to-date: certifi>=2018.04.16 in /volume1/@appstore/python3/lib/python3.5/site-packages (from homeassistant)
Collecting requests==2.19.1 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl
Collecting astral==1.6.1 (from homeassistant)
  Using cached https://files.pythonhosted.org/packages/01/2b/0b60f1cef7d2a7a863cd06bae5fc7e3553803739c4834e921b4996920f76/astral-1.6.1-py2.py3-none-any.whl
Requirement already up-to-date: pytz>=2018.04 in /volume1/@appstore/python3/lib/python3.5/site-packages (from homeassistant)
Requirement already up-to-date: multidict<5.0,>=4.0 in /volume1/@appstore/python3/lib/python3.5/site-packages (from aiohttp==3.4.4->homeassistant)
Requirement already up-to-date: idna-ssl>=1.0; python_version < "3.7" in /volume1/@appstore/python3/lib/python3.5/site-packages (from aiohttp==3.4.4->homeassistant)
Collecting yarl<2.0,>=1.0 (from aiohttp==3.4.4->homeassistant)
Requirement already up-to-date: chardet<4.0,>=2.0 in /volume1/@appstore/python3/lib/python3.5/site-packages (from aiohttp==3.4.4->homeassistant)
Collecting MarkupSafe>=0.23 (from jinja2>=2.10->homeassistant)
Requirement already up-to-date: cffi>=1.1 in /volume1/@appstore/python3/lib/python3.5/site-packages (from bcrypt==3.1.4->homeassistant)
Requirement already up-to-date: six>=1.4.1 in /volume1/@appstore/python3/lib/python3.5/site-packages (from bcrypt==3.1.4->homeassistant)
Collecting idna>=2.1 (from cryptography==2.3.1->homeassistant)
  Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography==2.3.1->homeassistant)
  Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting urllib3<1.24,>=1.21.1 (from requests==2.19.1->homeassistant)
  Using cached https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.1->bcrypt==3.1.4->homeassistant)
Building wheels for collected packages: bcrypt, cryptography
  Running setup.py bdist_wheel for bcrypt ... error
  Complete output from command /volume1/@appstore/python3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ppqn68jb/bcrypt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmphhr1esx8pip-wheel- --python-tag cp35:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-ppqn68jb/bcrypt/setup.py", line 238, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 334, in __init__
      _Distribution.__init__(self, attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/dist.py", line 281, in __init__
      self.finalize_options()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 468, in finalize_options
      ep.load()(self, ep.name, value)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 204, in cffi_modules
      add_cffi_module(dist, cffi_module)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
      execfile(build_file_name, mod_vars)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 25, in execfile
      exec(code, glob, glob)
    File "src/build_bcrypt.py", line 21, in <module>
      ffi = FFI()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py", line 54, in __init__
      backend.__version__, backend.__file__))
  Exception: Version mismatch: this is the 'cffi' package version 1.11.5, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.11.2, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/_cffi_backend.cpython-35m-arm-linux-gnueabi.so'.  The two versions should be equal; check your installation.
  
  ----------------------------------------
  Failed building wheel for bcrypt
  Running setup.py clean for bcrypt
  Complete output from command /volume1/@appstore/python3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ppqn68jb/bcrypt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-ppqn68jb/bcrypt/setup.py", line 238, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 334, in __init__
      _Distribution.__init__(self, attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/dist.py", line 281, in __init__
      self.finalize_options()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 468, in finalize_options
      ep.load()(self, ep.name, value)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 204, in cffi_modules
      add_cffi_module(dist, cffi_module)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
      execfile(build_file_name, mod_vars)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 25, in execfile
      exec(code, glob, glob)
    File "src/build_bcrypt.py", line 21, in <module>
      ffi = FFI()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py", line 54, in __init__
      backend.__version__, backend.__file__))
  Exception: Version mismatch: this is the 'cffi' package version 1.11.5, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.11.2, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/_cffi_backend.cpython-35m-arm-linux-gnueabi.so'.  The two versions should be equal; check your installation.
  
  ----------------------------------------
  Failed cleaning build dir for bcrypt
  Running setup.py bdist_wheel for cryptography ... error
  Complete output from command /volume1/@appstore/python3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ppqn68jb/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp056sx2owpip-wheel- --python-tag cp35:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-ppqn68jb/cryptography/setup.py", line 318, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 334, in __init__
      _Distribution.__init__(self, attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/dist.py", line 281, in __init__
      self.finalize_options()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 468, in finalize_options
      ep.load()(self, ep.name, value)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 204, in cffi_modules
      add_cffi_module(dist, cffi_module)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
      execfile(build_file_name, mod_vars)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 25, in execfile
      exec(code, glob, glob)
    File "src/_cffi_src/build_openssl.py", line 106, in <module>
      extra_link_args=extra_link_args(compiler_type()),
    File "/tmp/pip-build-ppqn68jb/cryptography/src/_cffi_src/utils.py", line 49, in build_ffi_for_binding
      extra_link_args=extra_link_args,
    File "/tmp/pip-build-ppqn68jb/cryptography/src/_cffi_src/utils.py", line 57, in build_ffi
      ffi = FFI()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py", line 54, in __init__
      backend.__version__, backend.__file__))
  Exception: Version mismatch: this is the 'cffi' package version 1.11.5, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.11.2, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/_cffi_backend.cpython-35m-arm-linux-gnueabi.so'.  The two versions should be equal; check your installation.
  
  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py clean for cryptography
  Complete output from command /volume1/@appstore/python3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ppqn68jb/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-ppqn68jb/cryptography/setup.py", line 318, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 334, in __init__
      _Distribution.__init__(self, attrs)
    File "/volume1/@appstore/python3/lib/python3.5/distutils/dist.py", line 281, in __init__
      self.finalize_options()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 468, in finalize_options
      ep.load()(self, ep.name, value)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 204, in cffi_modules
      add_cffi_module(dist, cffi_module)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
      execfile(build_file_name, mod_vars)
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 25, in execfile
      exec(code, glob, glob)
    File "src/_cffi_src/build_openssl.py", line 106, in <module>
      extra_link_args=extra_link_args(compiler_type()),
    File "/tmp/pip-build-ppqn68jb/cryptography/src/_cffi_src/utils.py", line 49, in build_ffi_for_binding
      extra_link_args=extra_link_args,
    File "/tmp/pip-build-ppqn68jb/cryptography/src/_cffi_src/utils.py", line 57, in build_ffi
      ffi = FFI()
    File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py", line 54, in __init__
      backend.__version__, backend.__file__))
  Exception: Version mismatch: this is the 'cffi' package version 1.11.5, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.11.2, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/_cffi_backend.cpython-35m-arm-linux-gnueabi.so'.  The two versions should be equal; check your installation.
  
  ----------------------------------------
  Failed cleaning build dir for cryptography
Failed to build bcrypt cryptography
Installing collected packages: pip, attrs, async-timeout, idna, yarl, aiohttp, voluptuous-serialize, bcrypt, asn1crypto, cryptography, urllib3, requests, astral, homeassistant, MarkupSafe, pycparser
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
  Found existing installation: attrs 17.4.0
    Uninstalling attrs-17.4.0:
      Successfully uninstalled attrs-17.4.0
  Found existing installation: async-timeout 2.0.0
    Uninstalling async-timeout-2.0.0:
      Successfully uninstalled async-timeout-2.0.0
  Found existing installation: idna 2.6
    Uninstalling idna-2.6:
      Successfully uninstalled idna-2.6
  Found existing installation: yarl 1.1.0
    Uninstalling yarl-1.1.0:
      Successfully uninstalled yarl-1.1.0
  Found existing installation: aiohttp 2.3.10
    Uninstalling aiohttp-2.3.10:
      Successfully uninstalled aiohttp-2.3.10
  Found existing installation: bcrypt 3.1.2
    Uninstalling bcrypt-3.1.2:
      Successfully uninstalled bcrypt-3.1.2
  Running setup.py install for bcrypt ... error
    Complete output from command /volume1/@appstore/python3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ppqn68jb/bcrypt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cidwr6y2-record/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ppqn68jb/bcrypt/setup.py", line 238, in <module>
        **keywords_with_side_effects(sys.argv)
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/volume1/@appstore/python3/lib/python3.5/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 334, in __init__
        _Distribution.__init__(self, attrs)
      File "/volume1/@appstore/python3/lib/python3.5/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/setuptools/dist.py", line 468, in finalize_options
        ep.load()(self, ep.name, value)
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 204, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "src/build_bcrypt.py", line 21, in <module>
        ffi = FFI()
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py", line 54, in __init__
        backend.__version__, backend.__file__))
    Exception: Version mismatch: this is the 'cffi' package version 1.11.5, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.11.2, located in '/volume1/@appstore/python3/lib/python3.5/site-packages/_cffi_backend.cpython-35m-arm-linux-gnueabi.so'.  The two versions should be equal; check your installation.
    
    ----------------------------------------
  Rolling back uninstall of bcrypt
Command "/volume1/@appstore/python3/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ppqn68jb/bcrypt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cidwr6y2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ppqn68jb/bcrypt/

Never mind :smile:~
I managed to fix it!!!
I solved the mismatch problem by uninstall the cffi first and delete the cffi_backend file that still lifted in the “site-packages” folder.
and solved the bcrypt, cryptography by adding them both to the “requirements.txt” in the cross-compiled section, then installed them using pip.
after successfully installed the home assistant 0.80.3
When starting the home assistant the first time, the log showed that it attempted to install some packages “peyote, PyQRCode, pho-mqtt…”, so I when back to the “requirements.txt” and add them in the list to build and get the wheel file again… and installed them with pip.
after all that~ now I have the 0.80.3 running :slight_smile:

Thanks again for your BIG help~!!!

Hello. Good job to all that in the end make running the last version of HA possible for the non docker Synologys.

Can someone make a complete detailed guide into one big post for the other users, please?

@thy1225 is 0.80.3 running smoothly? Any bugs or glitches so far?

Thanks for this forum and you guys~ :slight_smile:
It’s usable to me but not everything is working right~
I don’t have many devices, all I have is two switches and two camera (all works)

“HomeKit” & “cloud” both doesn’t work…
About HomeKit according to the log I cross-compiled and installed “HAP-python, ed25519, curve25519_donna and pycryptodome”, but it still give me this error

    2018-10-25 11:35:54 ERROR (MainThread) [homeassistant.setup] Error during setup of component homekit
    Traceback (most recent call last):
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
        hass, processed_config)
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 81, in async_setup
        await hass.async_add_job(homekit.setup)
      File "/volume1/@appstore/python3/lib/python3.5/asyncio/futures.py", line 381, in __iter__
        yield self  # This tells Task to wait for completion.
      File "/volume1/@appstore/python3/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
        future.result()
      File "/volume1/@appstore/python3/lib/python3.5/asyncio/futures.py", line 294, in result
        raise self._exception
      File "/volume1/@appstore/python3/lib/python3.5/concurrent/futures/thread.py", line 55, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/homeassistant/components/homekit/__init__.py", line 210, in setup
        from .accessories import HomeBridge, HomeDriver
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/homeassistant/components/homekit/accessories.py", line 8, in <module>
        from pyhap.accessory_driver import AccessoryDriver
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/pyhap/accessory_driver.py", line 44, in <module>
        from pyhap.encoder import AccessoryEncoder
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/pyhap/encoder.py", line 9, in <module>
        import ed25519
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/ed25519/__init__.py", line 1, in <module>
        from .keys import (BadSignatureError, BadPrefixError,
      File "/volume1/@appstore/python3/lib/python3.5/site-packages/ed25519/keys.py", line 3, in <module>
        from . import _ed25519
    ImportError: cannot import name '_ed25519'

About the Cloud, “logins” and “forgot my password” both doesn’t work, it’ll show “Unknown error” in the web UI. The first time I run HA with cloud I saw the log is trying to install “warrant, pyfttt”, I want to cross-compile the “warrant” but it failed… with something like:

from pip.req import parse_requirements
ImportError: No module named pip.req

right now every time I try to use the cloud login or reseting the password, I’ll get this error:

2018-10-25 11:36:00 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 192.168.0.114 (auth: False)
2018-10-25 11:36:01 INFO (MainThread) [homeassistant.components.http.view] Serving /auth/token to 192.168.0.114 (auth: False)
ore/python3/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/volume1/@appstore/python3/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/volume1/@appstore/python3/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/volume1/@appstore/python3/lib/python3.5/site-packages/homeassistant/components/cloud/auth_api.py", line 81, in forgot_password
    cognito = _cognito(cloud, username=email)
  File "/volume1/@appstore/python3/lib/python3.5/site-packages/homeassistant/components/cloud/auth_api.py", line 140, in _cognito
    from warrant import Cognito
  File "/volume1/homeassistant/deps/lib/python3.5/site-packages/warrant/__init__.py", line 8, in <module>
    from jose import jwt, JWTError
  File "/volume1/homeassistant/deps/lib/python3.5/site-packages/jose/jwt.py", line 11, in <module>
    from jose import jws
  File "/volume1/homeassistant/deps/lib/python3.5/site-packages/jose/jws.py", line 8, in <module>
    from jose import jwk
  File "/volume1/homeassistant/deps/lib/python3.5/site-packages/jose/jwk.py", line 10, in <module>
    from jose.backends.base import Key
  File "/volume1/homeassistant/deps/lib/python3.5/site-packages/jose/backends/__init__.py", line 3, in <module>
    from jose.backends.pycrypto_backend import RSAKey
  File "/volume1/homeassistant/deps/lib/python3.5/site-packages/jose/backends/pycrypto_backend.py", line 7, in <module>
    from Crypto.PublicKey import RSA
  File "/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/PublicKey/RSA.py", line 38, in <module>
    from Crypto.IO import PKCS8, PEM
  File "/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/IO/PKCS8.py", line 44, in <module>
    from Crypto.IO._PBES import PBES1, PBES2, PbesError
  File "/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/IO/_PBES.py", line 43, in <module>
    from Crypto.Hash import MD5, SHA1
  File "/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Hash/MD5.py", line 47, in <module>
    """)
  File "/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/_raw_api.py", line 258, in load_pycryptodome_raw_lib
    raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'Crypto.Hash._MD5': Trying '_MD5.cpython-35m-arm-linux-gnueabi.so': cannot load library '/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.cpython-35m-arm-linux-gnueabi.so': /volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.cpython-35m-arm-linux-gnueabi.so: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.cpython-35m-arm-linux-gnueabi.so', Trying '_MD5.abi3.so': cannot load library '/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.abi3.so': /volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.abi3.so: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.abi3.so', Trying '_MD5.so': cannot load library '/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.so': /volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.so: cannot open shared object file: No such file or directory.  Additionally, ctypes.util.find_library() did not manage to locate a library called '/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.so'

so…I’m currently stocking here…not sure what to do next to fix them…

I also had a problem with pycryptodome.
Inside the wheel file (as generated by the spksrc toolchain), the cross-compiled binary files (*.so) had the wrong file name.
The synology was looking for somethink like _raw_ecb.cpython-35m-arm-linux-gnueabihf.so, but the binary was called _raw_ecb.cpython-35m-x86_64-linux-gnu.so. I guess the “x86_64” is taken by the toolchain from the host system rather than the target system.
Anyway, after I renamed all *.so files inside the wheel file with 7zip, and re-installed the wheel file on synology, it worked.

Check your error log, what exact file name the synology is looking for:
OSError: Cannot load native module 'Crypto.Hash._MD5': Trying '_MD5.cpython-35m-arm-linux-gnueabi.so': cannot load library '/volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.cpython-35m-arm-linux-gnueabi.so': /volume1/@appstore/python3/lib/python3.5/site-packages/Crypto/Util/../Hash/_MD5.cpython-35m-arm-linux-gnueabi.so: cannot open shared object file: No such file or directory.

1 Like

I see!!!
Thanks :slight_smile:
I’ll give it a try tonight!!!

and… have you tried the HomeKit function? did you manage to get it work?
Thank you~

BIG Thanks @hogi1200 !!
Your method works for me~
Now I got the HA Cloud & HomeKit both working!!!

I replace all the " x86_64-linux-gnu" to " arm-linux-gnueabihf" in some wheel file (curve25519, ed25519, pycryptodome) and deleted the old one than install the new ones.

After that, both cloud and HomeKit is working for now!!!
Can’t thank you enough for your help ~~!!!

I’m really glad for you guys. It’ll be really nice one of you to summ it up into one post and then I’ll try to make more detail orientated tutorial and to push it to the docs.

@hogi1200 & @thy1225 Could I ask you that your python package is compatible with my DS214+ ? And if yes, how can I install it to my Synology? Thank you in advance.

I’m not sure about DS214+, I’m on DS212j. But I happen to still keeping some of the package wheel files, so you can see if they work for you. the files are here https://ufile.io/y43ic (the file will be deleted after 30days by the site)

1 Like

Thank you @thy1225

I successfully complied homeassistant and with the packages with spksrc. I have only one problem right now.

2018-11-20 08:51:30 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 390, in start
    resp = await self._request_handler(request)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/aiohttp/web_app.py", line 366, in _handle
    resp = await handler(request)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/aiohttp/web_middlewares.py", line 106, in impl
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/static.py", line 66, in staticresource_middleware
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/ban.py", line 66, in ban_middleware
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/auth.py", line 97, in auth_middleware
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/ban.py", line 66, in ban_middleware
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/auth.py", line 97, in auth_middleware
    return await handler(request)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/view.py", line 113, in handle
    result = await result
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/cloud/http_api.py", line 81, in error_handler
    result = await handler(view, request, *args, **kwargs)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http/data_validator.py", line 47, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/cloud/http_api.py", line 138, in post
    data['password'])
  File "/usr/local/python3/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/python3/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/local/python3/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/local/python3/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/cloud/auth_api.py", line 91, in login
    cognito = _authenticate(cloud, email, password)
  File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/cloud/auth_api.py", line 144, in _authenticate
    cognito.authenticate(password=password)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/warrant/__init__.py", line 383, in authenticate
    self.verify_token(tokens['AuthenticationResult']['IdToken'],'id_token','id')
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/warrant/__init__.py", line 206, in verify_token
    issuer=unverified_claims.get('iss'))
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/jose/jwt.py", line 132, in decode
    payload = jws.verify(token, key, algorithms, verify=verify_signature)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/jose/jws.py", line 75, in verify
    _verify_signature(signing_input, header, signature, key, algorithms)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/jose/jws.py", line 262, in _verify_signature
    if not _sig_matches_keys(keys, signing_input, signature, alg):
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/jose/jws.py", line 210, in _sig_matches_keys
    key = jwk.construct(key, alg)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/jose/jwk.py", line 61, in construct
    return key_class(key_data, algorithm)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/jose/backends/cryptography_backend.py", line 148, in __init__
    self.prepared_key = self._process_jwk(key)
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/jose/backends/cryptography_backend.py", line 174, in _process_jwk
    verifying_key = rsa.RSAPublicNumbers(e, n).public_key(self.cryptography_backend())
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 53, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/usr/local/homeassistant/env/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /usr/local/homeassistant/env/lib/python3.5/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: pthread_atfork

Anyone get the same error when I try to login to cloud services?

I had problems with the cloud login too, but it was solved by following @hogi1200 's solution in his post.

I’m not sure if this the problem for you right now but if you compiled some of the whl files on your own, maybe you can see if those packages have the same naming problem.

Finally get it resolved. I complied the wrong python3 site-packages again with spksrc. The required enviroment variable is the following:

export CFLAGS=-pthread

Affected site-packages are: cffi==1.11.2 && cryptography==2.3.1

Now, I have fully working cloud :slight_smile: and Xiaomi Robot Vacuum with the latest Home Assistant 0.82 on DS214+

Congratulations! I’d also upgraded to 0.82 and everything’s working fine. :slight_smile:

1 Like

From yesterday there is a new update for the python3 package from the synocommunity repo. The new version of supported python is 3.5.6-8 with added modules for sqlite3 and lxml. Later todat I’ll try to install Home-Assistant with it.

Is it possible to install the latest HomeAssistant (0.83.0 and later) with python 3.5.6.8?
Anyone has a detailed step by step instruction how to do this on an older Synology (DS212)?

HA only needs python3>3.5.2 I think

Did you manage to get python 3.5.6-8 to work on Synology and install latest HA?

I went to this thread because i’m having your same issue, can you explain what procedure i have to follow to install home assistant on synology ds215j?

yesterday i followed this guide https://www.home-assistant.io/docs/installation/synology/ without success, the process wont start.

after i’ve found this guide Home Assistant won't start on Synology DS115j NAS that tell’s to downgrade pip with sudo python3 -m pip install pip==9.0.1 process started but no web page access.

after tryed this modification https://www.home-assistant.io/docs/ecosystem/synology/ but still no web page access.

what i have to do now? i uninstall everything and use the package in this page?
http://spk.chickenandporn.com/?arch=armada375#
i have to mantain the user and the folder or start from zero?

thank you