JE-Random-Tech / ProJEcts

All code to the JE Random Tech Videos can be found here
0 stars 2 forks source link

Paramspec error #5

Open JE-Random-Tech opened 2 years ago

ianhughcampbell commented 1 year ago

Left a comment on your YouTube video too. I had the same problem with the import error. Here is the error thread:

%Run HapticBoard.py Traceback (most recent call last): File "/home/pi/ProJEcts/Haptic Board/HapticBoard.py", line 2, in from omxplayer.player import OMXPlayer File "", line 259, in load_module File "/usr/local/lib/python3.9/dist-packages/omxplayer_wrapper-0.3.3-py3.9.egg/omxplayer/init.py", line 1, in from omxplayer.player import OMXPlayer File "", line 259, in load_module File "/usr/local/lib/python3.9/dist-packages/omxplayer_wrapper-0.3.3-py3.9.egg/omxplayer/player.py", line 25, in from evento import Event File "/usr/local/lib/python3.9/dist-packages/evento-2.0.1-py3.9.egg/evento/init.py", line 2, in from .decorators import ( File "/usr/local/lib/python3.9/dist-packages/evento-2.0.1-py3.9.egg/evento/decorators.py", line 4, in from .signature import AsyncSignatureEvent, P, R, SignatureEvent File "/usr/local/lib/python3.9/dist-packages/evento-2.0.1-py3.9.egg/evento/signature.py", line 1, in from typing import ( ImportError: cannot import name 'ParamSpec' from 'typing' (/usr/lib/python3.9/typing.py)

python programing is not my strength. Any guidance would be greatly appreciated. I tried playing around with typing_extensions, but I really don't know what or how to import what I need.

ianhughcampbell commented 1 year ago

I think I was able to correct the paramspec issue by importing paramspec from typing_extensions and not typing.py

However, now I get this error when I run the script:

@raspberrypi:~/ProJEcts/Haptic Board $ python3 HapticBoard.py Traceback (most recent call last): File "/home/pi/ProJEcts/Haptic Board/HapticBoard.py", line 100, in 0: newVideoInit(0), File "/home/pi/ProJEcts/Haptic Board/HapticBoard.py", line 70, in newVideoInit return OMXPlayer(files[videoIndex], args=['--no-keys','--no-osd', '-b','--layer', '2', '--video_queue', '1', '--loop'], dbus_name='omxplayer.player'+str(videoIndex),pause=True) File "/usr/local/lib/python3.9/dist-packages/omxplayer_wrapper-0.3.3-py3.9.egg/omxplayer/player.py", line 154, in init File "/usr/local/lib/python3.9/dist-packages/omxplayer_wrapper-0.3.3-py3.9.egg/omxplayer/player.py", line 251, in load File "/usr/local/lib/python3.9/dist-packages/omxplayer_wrapper-0.3.3-py3.9.egg/omxplayer/player.py", line 160, in _load_source File "/usr/local/lib/python3.9/dist-packages/omxplayer_wrapper-0.3.3-py3.9.egg/omxplayer/player.py", line 207, in _setup_omxplayer_process File "/usr/local/lib/python3.9/dist-packages/omxplayer_wrapper-0.3.3-py3.9.egg/omxplayer/player.py", line 189, in _run_omxplayer File "/usr/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'omxplayer'

If you like, I can open a new issue.

JE-Random-Tech commented 1 year ago

Ah no worries. Sorry about the very late reply i missed the notification. Unfortunately right now i am not using the code so i am limited on testing it. How did you install the omxplayer? It also seems that the maintenance of the Omxplayer has stopped. So maybe you need to use an older version of python for the player to be working. I believe in the video i was using version 3.7.