moroen / IKEA-Tradfri-plugin

A Python plugin for Domoticz to controll IKEA Gateway
68 stars 23 forks source link

Can't install py3coap #98

Closed djs45 closed 4 years ago

djs45 commented 4 years ago

Hello. I wan't to test and use Tradfri with my Domoticz but I can't install py3coap. This is the error : Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting py3coap Using cached py3coap-0.8.0.tar.gz (5.3 kB) ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nk8dbhfw/py3coap/setup.py'"'"'; file='"'"'/tmp/pip-install-nk8dbhfw/py3coap/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-nk8dbhfw/py3coap/pip-egg-info cwd: /tmp/pip-install-nk8dbhfw/py3coap/ Complete output (31 lines): ERROR: Package 'setuptools-golang' requires a different Python: 3.5.3 not in '>=3.6.1' Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/setuptools/installer.py", line 128, in fetch_build_egg subprocess.check_call(cmd) File "/usr/lib/python3.5/subprocess.py", line 271, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpvpu85hj0', '--quiet', 'setuptools-golang']' returned non-zero 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-install-nk8dbhfw/py3coap/setup.py", line 22, in <module>
    scripts=["pycoap-client"],
  File "/usr/local/lib/python3.5/dist-packages/setuptools/__init__.py", line 143, in setup
    _install_setup_requires(attrs)
  File "/usr/local/lib/python3.5/dist-packages/setuptools/__init__.py", line 138, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "/usr/local/lib/python3.5/dist-packages/setuptools/dist.py", line 721, in fetch_build_eggs
    replace_conflicting=True,
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 783, in resolve
    replace_conflicting=replace_conflicting
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 1066, in best_match
    return self.obtain(req, installer)
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 1078, in obtain
    return installer(requirement)
  File "/usr/local/lib/python3.5/dist-packages/setuptools/dist.py", line 777, in fetch_build_egg
    return fetch_build_egg(self, req)
  File "/usr/local/lib/python3.5/dist-packages/setuptools/installer.py", line 130, in fetch_build_egg
    raise DistutilsError(str(e))
distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpvpu85hj0', '--quiet', 'setuptools-golang']' returned non-zero exit status 1
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Can you help me ?

Many thanks in advance

moroen commented 4 years ago

You need a newer version of python: ERROR: Package 'setuptools-golang' requires a different Python: 3.5.3 not in '>=3.6.1'

If you can't upgrade your python version, take a look at using coapcmd instead.

Regards, M

djs45 commented 4 years ago

Hello and thanks for your answer. No way to upgrade python properly on raspbian. No way to use coapcmd (bash install doesn't work ?). After reflexion, I updated Raspbian to buster to have a true Pytahon 3.7.x and I work. I think it will be a good thing to keep compatibility with Raspbian stratch (and Python 3.5.3 in fact) BR Sebastien

moroen commented 4 years ago

Installing coapcmd requires a working go compiler, version 1.11 or higher. There are prebuild binaries of coapcmd for arm v6 and v7 in the repo (https://github.com/moroen/coapcmd/releases/tag/v0.1.2). These should work on any Pi with stretch, so coapcmd is how compatibility with stretch is kept.

There is way to get py3coap on python 3.5.x, but that requires compiling the extension manually. I think python3.5 is sufficiently old that I don't plan to maintain prebuild wheels for it, but if there's interest, I guess it's possible to create a Makefile for getting py3coap working for 3.5.x systems

Regards, M

djs45 commented 4 years ago

With Raspbian buster all is ok. Many thanks