I need Help - pip install socket.IO-client -failed

Hello everyone,

I have a little problem there. I am currently trying to use these instructions https://github.com/edmw/volumio-diy to have a USB RFID reader talk to Volumio.

I had already successfully set this up at the beginning of the year.

Unfortunately my SD card broke two weeks ago.

Now I fail at the point where I have to set up a virtual environment with python, namely when installing the socketIO client.

Volumio version: 2909

Python. 3.4

(volumio-hid) volumio @ lalabox: ~ $ python3 -m pip install socketIO-client
Downloading / unpacking socketIO-client
Downloading socketIO-client-0.7.2.tar.gz
Running setup.py (path: /tmp/pip-build-6xys8svt/socketIO-client/setup.py) egg_info for package socketIO-client


warning: no files found matching '* .html'
warning: no files found matching '* .js'
warning: no previously-included files matching '* .pyc' found anywhere in distribution
Downloading / unpacking requests> = 2.7.0 (from socketIO-client)
Downloading requests-2.26.0-py2.py3-none-any.whl (62kB): 62kB downloaded
Cleaning up ...
Exception:
Traceback (most recent call last):
File "/home/volumio/.pyenv/volumio-hid/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2595, in _dep_map
return self .__ dep_map
File "/home/volumio/.pyenv/volumio-hid/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2457, in __getattr__
raise AttributeError (attr)
AttributeError: _DistInfoDistribution__dep_map


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
File "/home/volumio/.pyenv/volumio-hid/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
status = self.run (options, args)
File "/home/volumio/.pyenv/volumio-hid/lib/python3.4/site-packages/pip/commands/install.py", line 290, in run
requirement_set.prepare_files (finder, force_root_egg_info = self.bundle, bundle = self.bundle)
File "/home/volumio/.pyenv/volumio-hid/lib/python3.4/site-packages/pip/req.py", line 1266, in prepare_files
req_to_install.extras):
File "/home/volumio/.pyenv/volumio-hid/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2401, in requires
dm = self._dep_map
File "/home/volumio/.pyenv/volumio-hid/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2597, in _dep_map
self .__ dep_map = self._compute_dependencies ()
File "/home/volumio/.pyenv/volumio-hid/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2621, in _compute_dependencies
parsed = next (parse_requirements (distvers))
File "/home/volumio/.pyenv/volumio-hid/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2721, in parse_requirements
"version spec")
File "/home/volumio/.pyenv/volumio-hid/lib/python-wheels/setuptools-5.5.1-py2.py3-none-any.whl/pkg_resources.py", line 2686, in scan_list
raise ValueError (msg, line, "at", line [p:])
ValueError: ('Expected version spec in', 'charset-normalizer ~ = 2.0.0', 'at', '~ = 2.0.0')


Storing debug log for failure in /home/volumio/.pip/pip.log

I already googled but can’t find a working solution. I’m not a programmer and I try to muddle my way through it. : conf:

Does anyone have an idea or does anyone know the problem?

Switch to Buster beta - that might be an easier solution.

Current (2.878+) images are partly stretch and partly buster, causing quite some chaos with dependency management.

Said and done. Volumio Version 3.083 installed.
But now it seems to disagree with the Python syntax. I now get when starting the service. The following message is displayed in journalctl.

  -- The unit volumio-hid.service has entered the 'failed' state with result 'exit-code'.
Sep 17 12:22:46 lalabox sudo[6690]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl restart volumio-hid.service
Sep 17 12:22:46 lalabox sudo[6690]: pam_unix(sudo:session): session opened for user root by volumio(uid=0)
Sep 17 12:22:46 lalabox systemd[1]: Stopped volumio-hid Service.
-- Subject: A stop job for unit volumio-hid.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit volumio-hid.service has finished.
--
-- The job identifier is 9363 and the job result is done.
Sep 17 12:22:46 lalabox systemd[1]: Started volumio-hid Service.
-- Subject: A start job for unit volumio-hid.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit volumio-hid.service has finished successfully.
--
-- The job identifier is 9363.
Sep 17 12:22:46 lalabox sudo[6690]: pam_unix(sudo:session): session closed for user root
Sep 17 12:22:46 lalabox python[6693]:   File "/home/volumio/volumio-hid/HID.py", line 303
Sep 17 12:22:46 lalabox python[6693]:     task = asyncio.async(read_events(hid))
Sep 17 12:22:46 lalabox python[6693]:                        ^
Sep 17 12:22:46 lalabox python[6693]: SyntaxError: invalid syntax
Sep 17 12:22:46 lalabox systemd[1]: volumio-hid.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit volumio-hid.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Sep 17 12:22:46 lalabox systemd[1]: volumio-hid.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit volumio-hid.service has entered the 'failed' state with result 'exit-code'.
Sep 17 12:22:50 lalabox sudo[6694]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/systemctl status volumio-hid.service
Sep 17 12:22:50 lalabox sudo[6694]: pam_unix(sudo:session): session opened for user root by volumio(uid=0)
Sep 17 12:22:50 lalabox sudo[6694]: pam_unix(sudo:session): session closed for user root

Can someone here help me with troubleshooting? Apparently there are problems with line 303 in HID.py.
In a task with asyncio.async …

task = asyncio.async (read_events (hid))
         task.add_done_callback (partial (read_events_done, device = hid))
         return task

Hmm, I would ask the author of the script for help…

Good luck! :slight_smile:

Looks like you need to update it to work with python 3.6+ code, as async is now a reserved word.
Or a low effort way if you are already using pyenv is to run it on Py3.6

I had already tried to contact the author of the Git article … unfortunately without success.

ok, unfortunately I am an absolute beginner when it comes to programming. So, does that mean that the word async is used somehow differently. So in the script no longer works. Yes, an update of the script would be cool. Unfortunately, I first have to understand Python in general (better from programming). But thank you for your answers.

Does anyone know whether there are already other solutions with a USB RFID reader, perhaps even as a plug-in?

So far I have only found one NFC reader plugin. But that addresses a wired RFC reader with 13.56 MHz. That probably also runs over the SPI interface.
No idea. Man, I wish I could understand the script better … :wink:

You could try posting here –

Or use pyenv to install 3.6

curl https://pyenv.run | bash
exec $SHELL
pyenv install 3.6
pyenv global system 3.6

And then go ahead with the previous stuff… Perhaps it is best to start forma a fresh image…

Hi,
I have now got the reader to work. I upgraded to Python 3.5.2 following these instructions Python 3 - #4 by Chris_Martini and then set up the environment with it.
The HID service is now running and recognizing the RFID cards. :tada:

@ashthespy Thanks again for your help. :+1: