Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python setup.py egg_info" failed with error code 1 #32

Closed
Heiner1967 opened this issue Sep 16, 2021 · 19 comments
Closed

python setup.py egg_info" failed with error code 1 #32

Heiner1967 opened this issue Sep 16, 2021 · 19 comments

Comments

@Heiner1967
Copy link

Heiner1967 commented Sep 16, 2021

I try to install fhempy but fail

first i install on my Pi Python 3.7 by executing
Code: [Auswählen]
sudo apt install python3 python3-pip python3-dev libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libglib2.0-dev libdbus-1-dev bluez libbluetooth-dev
and
Code: [Auswählen]
sudo cpan Protocol::WebSocket

then i extended the updateosurces in fhem by
Code: [Auswählen]
update add https://raw.githubusercontent.com/dom...
and executed update
then i create in fhem
Code: [Auswählen]
define local_pybinding BindingsIo Python

it generate as well the Pytonbinding_15733 which get to active,
but my local-pybinding is only "opened"

fhempy_log says:
Unable to install package fhempy>=0.1.12: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-9ja41_su/websockets/

What can i do to get this fixed?

@Heiner1967
Copy link
Author

as per https://stackoverflow.com/questions/35991403/pip-install-unroll-python-setup-py-egg-info-failed-with-error-code-1

Error code 1 is defined in errno.h and means Operation not permitted.

its recommended to either uninstall and reinstall or to upgrade which seems to help in most cases. I tried the same unfortunately with no improvement.

This permittion problem let me think if I might should change all files to "777" full access to anyone - but this should usualy rather be limited to specific files and I do not know which once.....

@fhempy
Copy link
Owner

fhempy commented Sep 17, 2021

local-pybinding should be only opened, there is nothing more it should do.

Try

sudo -u fhem bash
pip3 install --upgrade fhempy

Provide the log of pip install afterwards.

@Heiner1967
Copy link
Author

Heiner1967 commented Sep 17, 2021

Hi,
applogies local-pybinding is disconnected whilst Pythonbinding_15733 is active.

I tryed your suggestion, response is:

pip3 install --upgrade fhempy
Collecting fhempy
Using cached https://files.pythonhosted.org/packages/bb/ee/f3bc63c91e23bac785459be5268539a1268cf9e9c55868ccad5255346fbc/fhempy-0.1.117-py3-none-any.whl
Collecting websockets>=8.1 (from fhempy)
Using cached https://files.pythonhosted.org/packages/1c/f4/61aee1eb4baadf8477fb7f3bc6b04a50fe683ef8ad2f60282806821e4b3b/websockets-10.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'setuptools'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-cfb683ra/websockets/

May be to add, fhem is local installed on a single PI running on "Buster"

@Heiner1967
Copy link
Author

just deleted my fhem devices again and recreated, same thing,
did another fhem update and the monitor says this:

2021.09.17 17:34:39 1 : Downloading https://raw.githubusercontent.com/dominikkarall/fhempy/master/controls_pythonbinding.txt
2021.09.17 17:34:39 1 :
2021.09.17 17:34:39 1 : pythonbinding
2021.09.17 17:34:40 1 : nothing to do...
2021.09.17 17:34:40 1 : Calling /usr/bin/perl ./contrib/commandref_join.pl -noWarnings, this may take a while
2021.09.17 17:34:41 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)
2021.09.17 17:34:52 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)
2021.09.17 17:35:04 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)
2021.09.17 17:35:14 1 : BindingsIo: ERROR local_pybinding - error while connecting: 127.0.0.1: Verbindungsaufbau abgelehnt (111)

does this help finding the problem?

@fhempy
Copy link
Owner

fhempy commented Sep 17, 2021

Please try
sudo apt install python3-setuptools

Afterwards do pip3 install again as mentioned above.

@Heiner1967
Copy link
Author

Heiner1967 commented Sep 18, 2021

the pip3 brought some errors:
` Running setup.py bdist_wheel for websockets ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokeni ze;file='/tmp/pip-install-v5o2z0oz/websockets/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compi le(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-a7hjy28q --python-tag cp37:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: invalid command 'bdist_wheel'


Failed building wheel for websockets
Running setup.py clean for websockets
Running setup.py bdist_wheel for cffi ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokeni ze;file='/tmp/pip-install-v5o2z0oz/cffi/setup.py';f=getattr(tokenize, 'open' , open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(cod e, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-i3bkj7im --python-tag cp37:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: invalid command 'bdist_wheel'


Failed building wheel for cffi
Running setup.py clean for cffi
Running setup.py bdist_wheel for multidict ... done
Stored in directory: /home/fhemuser/.cache/pip/wheels/e7/05/d2/f5c04c29d0e4b23 4dbcd4b609b51f8c65d67ff9bbd01c904b1
Running setup.py bdist_wheel for yarl ... done
Stored in directory: /home/fhemuser/.cache/pip/wheels/dc/fc/db/bca151751ff7119f584686572f716c4b35637210a3e52f6050
Successfully built cryptography aiohttp multidict yarl
Failed to build websockets cffi
Installing collected packages: typing-extensions, zipp, importlib-metadata, six, pycparser, cffi, cryptography, attrs, chardet, multidict, async-timeout, idna, yarl, aiohttp, websockets, ifaddr, zeroconf, fhempy
Running setup.py install for cffi ... done
The script chardetect is installed in '/home/fhemuser/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Running setup.py install for websockets ... done
Successfully installed aiohttp-3.7.4 async-timeout-3.0.1 attrs-21.2.0 cffi-1.14.6 chardet-3.0.4 cryptography-3.3.2 fhempy-0.1.117 idna-3.2 ifaddr-0.1.7 importlib-metadata-4.8.1 multidict-5.1.0 pycparser-2.20 six-1.16.0 typing-extensions-3.10.0.2 websockets-10.0 yarl-1.6.3 zeroconf-0.36.0 zipp-3.5.0
`
however after update of local_pybinding the status changed to "PythonBinding offline"

the fhem related logfile says now in loops:
2021-09-18 08:28:46,176 - ERROR - main: Failed to install fhempy, exit now...
2021-09-18 08:29:36,170 - WARNING - main: Failed to load fhempy: No module named 'fhempy'
2021-09-18 08:29:36,171 - INFO - main: Attempting install of fhempy>=0.1.12
2021-09-18 08:30:54,934 - ERROR - main: Unable to install package fhempy>=0.1.12: Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 164, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 572, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 530, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 675, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 793, in _get_page
return _get_html_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 144, in _get_html_page
"Cache-Control": "max-age=0",
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/_internal/download.py", line 396, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 37, in send
cached_response = self.controller.cached_request(request)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/controller.py", line 111, in cached_request
resp = self.serializer.loads(request, cache_data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 114, in loads
return getattr(self, "_loads_v{0}".format(ver))(request, data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 176, in _loads_v2
cached = json.loads(zlib.decompress(data).decode("utf8"))
zlib.error: Error -5 while decompressing data: incomplete or truncated stream
2021-09-18 08:30:54,936 - ERROR - main: Failed to install fhempy, exit now...
2021-09-18 08:31:55,629 - WARNING - main: Failed to load fhempy: No module named 'fhempy'
2021-09-18 08:31:55,630 - INFO - main: Attempting install of fhempy>=0.1.12
2021-09-18 08:35:53,662 - WARNING - main: Failed to load fhempy: No module named 'fhempy'
2021-09-18 08:35:53,663 - INFO - main: Attempting install of fhempy>=0.1.12

@fhempy
Copy link
Owner

fhempy commented Sep 18, 2021

Try
sudo -u fhem bash
pip3 install wheel

After that install fhempy again.

@Heiner1967
Copy link
Author

Hi, got this feedback:

Collecting wheel
Using cached https://files.pythonhosted.org/packages/04/80/cad93b40262f5d09f6de82adbee452fd43cdff60830b56a74c5930f7e277/wheel-0.37.0-py2.py3-none-any.whl
Installing collected packages: wheel
The script wheel is installed in '/opt/fhem/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed wheel-0.37.0

deleted and defined local_pybinding again but status is still "PythonBinding offline"

the log says:

2021-09-18 10:43:18,119 - ERROR - main: Failed to install fhempy, exit now...
2021-09-18 10:44:18,661 - WARNING - main: Failed to load fhempy: No module named 'fhempy'
2021-09-18 10:44:18,663 - INFO - main: Attempting install of fhempy>=0.1.12
2021-09-18 10:46:52,235 - ERROR - main: Unable to install package fhempy>=0.1.12: Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 164, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 572, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 530, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 675, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 793, in _get_page
return _get_html_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 144, in _get_html_page
"Cache-Control": "max-age=0",
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/_internal/download.py", line 396, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 37, in send
cached_response = self.controller.cached_request(request)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/controller.py", line 111, in cached_request
resp = self.serializer.loads(request, cache_data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 114, in loads
return getattr(self, "_loads_v{0}".format(ver))(request, data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 176, in _loads_v2
cached = json.loads(zlib.decompress(data).decode("utf8"))
zlib.error: Error -5 while decompressing data: incomplete or truncated stream
2021-09-18 10:46:52,245 - ERROR - main: Failed to install fhempy, exit now...
2021-09-18 10:47:18,469 - WARNING - main: Failed to load fhempy: No module named 'fhempy'
2021-09-18 10:47:18,470 - INFO - main: Attempting install of fhempy>=0.1.12

@fhempy
Copy link
Owner

fhempy commented Sep 18, 2021

Ok, let's do
sudo pip3 install wheel

@Heiner1967
Copy link
Author

Hi, ok that worked now without error.

deleted and defined local_pybinding again but status is still "PythonBinding offline"

The Log:

2021-09-18 13:24:26,370 - ERROR - main: Failed to install fhempy, exit now...
2021-09-18 13:25:26,891 - WARNING - main: Failed to load fhempy: No module named 'fhempy'
2021-09-18 13:25:26,893 - INFO - main: Attempting install of fhempy>=0.1.12
2021-09-18 13:27:08,287 - WARNING - main: Failed to load fhempy: No module named 'fhempy'
2021-09-18 13:27:08,288 - INFO - main: Attempting install of fhempy>=0.1.12
2021-09-18 13:27:23,859 - ERROR - main: Unable to install package fhempy>=0.1.12: Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 164, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 572, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 530, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 675, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 793, in _get_page
return _get_html_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 144, in _get_html_page
"Cache-Control": "max-age=0",
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/_internal/download.py", line 396, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 37, in send
cached_response = self.controller.cached_request(request)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/controller.py", line 111, in cached_request
resp = self.serializer.loads(request, cache_data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 114, in loads
return getattr(self, "_loads_v{0}".format(ver))(request, data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 176, in _loads_v2
cached = json.loads(zlib.decompress(data).decode("utf8"))
zlib.error: Error -5 while decompressing data: incomplete or truncated stream
2021-09-18 13:27:23,860 - ERROR - main: Failed to install fhempy, exit now..

It feels we come closer.... I am realy happy for your help and hope we get the rest fixed as well.

@fhempy
Copy link
Owner

fhempy commented Sep 18, 2021

sudo -u fhem bash
pip3 install fhempy

Post the pip3 output to see what's going on now.

@Heiner1967
Copy link
Author

Heiner1967 commented Sep 18, 2021

Hi,
it shows:
Collecting fhempy
Using cached https://files.pythonhosted.org/packages/bb/ee/f3bc63c91e23bac785459be5268539a1268cf9e9c55868ccad5255346fbc/fhempy-0.1.117-py3-none-any.whl
Collecting aiohttp==3.7.4 (from fhempy)
Using cached https://files.pythonhosted.org/packages/7a/95/eb60aaad7943e18c9d091de93c9b0b5ed40aa67c7d5e3c5ee9b36f100a38/aiohttp-3.7.4.tar.gz
Installing build dependencies ... done
Collecting websockets>=8.1 (from fhempy)
Using cached https://files.pythonhosted.org/packages/1c/f4/61aee1eb4baadf8477fb7f3bc6b04a50fe683ef8ad2f60282806821e4b3b/websockets-10.0.tar.gz
Collecting cryptography==3.3.2 (from fhempy)
Using cached https://files.pythonhosted.org/packages/d4/85/38715448253404186029c575d559879912eb8a1c5d16ad9f25d35f7c4f4c/cryptography-3.3.2.tar.gz
Installing build dependencies ... done
Collecting importlib-metadata>=3.3.0 (from fhempy)
Using cached https://files.pythonhosted.org/packages/71/c2/cb1855f0b2a0ae9ccc9b69f150a7aebd4a8d815bd951e74621c4154c52a8/importlib_metadata-4.8.1-py3-none-any.whl
Collecting zeroconf==0.36.0 (from fhempy)
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 164, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 572, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 530, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 675, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 793, in _get_page
return _get_html_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 144, in _get_html_page
"Cache-Control": "max-age=0",
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/_internal/download.py", line 396, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.21.0-py2.py3-none-any.whl/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 37, in send
cached_response = self.controller.cached_request(request)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/controller.py", line 111, in cached_request
resp = self.serializer.loads(request, cache_data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 114, in loads
return getattr(self, "_loads_v{0}".format(ver))(request, data)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/serialize.py", line 176, in _loads_v2
cached = json.loads(zlib.decompress(data).decode("utf8"))
zlib.error: Error -5 while decompressing data: incomplete or truncated stream

could it be, that I should have done : sudo pip3 install fhempy ?

@fhempy
Copy link
Owner

fhempy commented Sep 18, 2021

I think something is broken on your system. Which operating system did you install on your RPi?

@Heiner1967
Copy link
Author

Hi,

it's an Armbian 21.02.3 Buster.

So far anything esle went well and run's fine. It's a BananaPi

@Heiner1967
Copy link
Author

Heiner1967 commented Sep 18, 2021

just trying "sudo pip3 install fhempy" - it run better:

As log seems ok:
Collecting fhempy
Downloading https://files.pythonhosted.org/packages/bb/ee/f3bc63c91e23bac785459be5268539a1268cf9e9c55868ccad5255346fbc/fhempy-0.1.117-py3-none-any.whl (4.5MB)
100% |████████████████████████████████| 4.5MB 36kB/s
Collecting websockets>=8.1 (from fhempy)
Downloading https://files.pythonhosted.org/packages/1c/f4/61aee1eb4baadf8477fb7f3bc6b04a50fe683ef8ad2f60282806821e4b3b/websockets-10.0.tar.gz (81kB)
100% |████████████████████████████████| 81kB 741kB/s
Collecting importlib-metadata>=3.3.0 (from fhempy)
Downloading https://files.pythonhosted.org/packages/71/c2/cb1855f0b2a0ae9ccc9b69f150a7aebd4a8d815bd951e74621c4154c52a8/importlib_metadata-4.8.1-py3-none-any.whl
Collecting zeroconf==0.36.0 (from fhempy)
Downloading https://files.pythonhosted.org/packages/da/05/ca9d3e818319e8b507ebbfede72f27c7ec3053285c7c3434f74d6e7765ed/zeroconf-0.36.0-py3-none-any.whl (92kB)
100% |████████████████████████████████| 102kB 502kB/s
Collecting aiohttp==3.7.4 (from fhempy)
Downloading https://files.pythonhosted.org/packages/7a/95/eb60aaad7943e18c9d091de93c9b0b5ed40aa67c7d5e3c5ee9b36f100a38/aiohttp-3.7.4.tar.gz (1.1MB)
100% |████████████████████████████████| 1.1MB 136kB/s
Installing build dependencies ... done
Collecting cryptography==3.3.2 (from fhempy)
Downloading https://files.pythonhosted.org/packages/d4/85/38715448253404186029c575d559879912eb8a1c5d16ad9f25d35f7c4f4c/cryptography-3.3.2.tar.gz (539kB)
100% |████████████████████████████████| 542kB 180kB/s
Installing build dependencies ... done
Collecting typing-extensions>=3.6.4; python_version < "3.8" (from importlib-metadata>=3.3.0->fhempy)
Downloading https://files.pythonhosted.org/packages/74/60/18783336cc7fcdd95dae91d73477830aa53f5d3181ae4fe20491d7fc3199/typing_extensions-3.10.0.2-py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata>=3.3.0->fhempy)
Downloading https://files.pythonhosted.org/packages/92/d9/89f433969fb8dc5b9cbdd4b4deb587720ec1aeb59a020cf15002b9593eef/zipp-3.5.0-py3-none-any.whl
Collecting ifaddr>=0.1.7 (from zeroconf==0.36.0->fhempy)
Downloading https://files.pythonhosted.org/packages/92/0f/a577a724c03982b800232713874e805c8fcc14f4a2c3060902ed20b50da8/ifaddr-0.1.7-py2.py3-none-any.whl
Collecting attrs>=17.3.0 (from aiohttp==3.7.4->fhempy)
Downloading https://files.pythonhosted.org/packages/20/a9/ba6f1cd1a1517ff022b35acd6a7e4246371dfab08b8e42b829b6d07913cc/attrs-21.2.0-py2.py3-none-any.whl (53kB)
100% |████████████████████████████████| 61kB 554kB/s
Collecting chardet<4.0,>=2.0 (from aiohttp==3.7.4->fhempy)
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 346kB/s
Collecting multidict<7.0,>=4.5 (from aiohttp==3.7.4->fhempy)
Downloading https://files.pythonhosted.org/packages/1c/74/e8b46156f37ca56d10d895d4e8595aa2b344cff3c1fb3629ec97a8656ccb/multidict-5.1.0.tar.gz (53kB)
100% |████████████████████████████████| 61kB 785kB/s
Installing build dependencies ... done
Collecting async_timeout<4.0,>=3.0 (from aiohttp==3.7.4->fhempy)
Downloading https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Collecting yarl<2.0,>=1.0 (from aiohttp==3.7.4->fhempy)
Downloading https://files.pythonhosted.org/packages/97/e7/af7219a0fe240e8ef6bb555341a63c43045c21ab0392b4435e754b716fa1/yarl-1.6.3.tar.gz (176kB)
100% |████████████████████████████████| 184kB 556kB/s
Installing build dependencies ... done
Collecting six>=1.4.1 (from cryptography==3.3.2->fhempy)
Downloading https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting cffi>=1.12 (from cryptography==3.3.2->fhempy)
Collecting idna>=2.0 (from yarl<2.0,>=1.0->aiohttp==3.7.4->fhempy)
Downloading https://files.pythonhosted.org/packages/d7/77/ff688d1504cdc4db2a938e2b7b9adee5dd52e34efbd2431051efc9984de9/idna-3.2-py3-none-any.whl (59kB)
100% |████████████████████████████████| 61kB 819kB/s
Collecting pycparser (from cffi>=1.12->cryptography==3.3.2->fhempy)
Using cached https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl
Building wheels for collected packages: websockets, aiohttp, cryptography, multidict, yarl
Running setup.py bdist_wheel for websockets ... done
Stored in directory: /root/.cache/pip/wheels/4a/fb/05/478176debdae14973ba6a66985c39f13dd3d4267e04190abe3
Running setup.py bdist_wheel for aiohttp ... done
Stored in directory: /root/.cache/pip/wheels/3d/26/26/f84c3720e7cce4044fe6b806ba353daebc57e189f0b9b0b014
Running setup.py bdist_wheel for cryptography ... done
Stored in directory: /root/.cache/pip/wheels/87/95/40/0e53ecde4c59a0ab0b393585355de608456974d6408e1bfc7d
Running setup.py bdist_wheel for multidict ... done
Stored in directory: /root/.cache/pip/wheels/e7/05/d2/f5c04c29d0e4b234dbcd4b609b51f8c65d67ff9bbd01c904b1
Running setup.py bdist_wheel for yarl ... done
Stored in directory: /root/.cache/pip/wheels/dc/fc/db/bca151751ff7119f584686572f716c4b35637210a3e52f6050
Successfully built websockets aiohttp cryptography multidict yarl
Installing collected packages: websockets, typing-extensions, zipp, importlib-metadata, ifaddr, zeroconf, attrs, chardet, multidict, async-timeout, idna, yarl, aiohttp, six, pycparser, cffi, cryptography, fhempy
Successfully installed aiohttp-3.7.4 async-timeout-3.0.1 attrs-21.2.0 cffi-1.14.6 chardet-3.0.4 cryptography-3.3.2 fhempy-0.1.117 idna-3.2 ifaddr-0.1.7 importlib-metadata-4.8.1 multidict-5.1.0 pycparser-2.20 six-1.16.0 typing-extensions-3.10.0.2 websockets-10.0 yarl-1.6.3 zeroconf-0.36.0 zipp-3.5.0

then again deleting and defining in fhem and the log says:

2021-09-18 21:08:44,505 - INFO - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-09-18 21:08:44,616 - INFO - fhempy.lib.pkg_installer: Attempting install of async-upnp-client==0.20.0
2021-09-18 21:08:44,653 - WARNING - asyncio: Executing <Task pending coro=<async_main() running at /usr/local/lib/python3.7/dist-packages/fhempy/lib/fhem_pythonbinding.py:442> wait_for=<Future pending cb=[_chain_future.._call_check_cancel() at /usr/lib/python3.7/asyncio/futures.py:348, <TaskWakeupMethWrapper object at 0xb5c7c8b0>()] created at /usr/lib/python3.7/asyncio/base_events.py:396> cb=[_run_until_complete_cb() at /usr/lib/python3.7/asyncio/base_events.py:158] created at /usr/lib/python3.7/asyncio/base_events.py:563> took 0.143 seconds
2021-09-18 21:09:26,385 - INFO - fhempy.lib.pkg_installer: Successfully installed async-upnp-client==0.20.0 update!
2021-09-18 21:09:26,394 - INFO - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-09-18 21:09:26,598 - WARNING - asyncio: Executing <Handle <TaskWakeupMethWrapper object at 0xb5c7c8b0>() created at /usr/lib/python3.7/asyncio/futures.py:323> took 0.205 seconds
2021-09-18 21:09:26,608 - INFO - websockets.server: server listening on 0.0.0.0:15733

@fhempy
Copy link
Owner

fhempy commented Sep 18, 2021

Looks good, does it work now?

As it works as root it seems that you messed up the permissions in /opt/fhem. All files should be owned by fhem within this directory and all subdirs.

@Heiner1967
Copy link
Author

Heiner1967 commented Sep 18, 2021

Hi,

still pybinding offline.

all files in /lpt/fhem as well in opt/fhem/FHEM are owner fhem,
as well subfolder www, lib, log of opt/fhem have only owner fhem

anyhow should in folder /opt/fhem a command: sudo chown -R fhem . do the trick?

What I recognise however are differnt access rights for the files most often is at -rw-r--r--

@fhempy
Copy link
Owner

fhempy commented Sep 19, 2021

Yes,
sudo chown -R fhem /opt/fhem
should do the trick

@Heiner1967
Copy link
Author

Heiner1967 commented Sep 20, 2021

Hey it works, hurray.

Many Thanks for your work, I would have got anywhere without it.

I still don't understand what I did wrong, but anyhow, now its running.
...time to get Tuya running now on this....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants