I successfully installed gi but I was not able to run your script
Traceback (most recent call last):
File "test.py", line 4, in <module>
gi.require_version('Gst', '1.0')
File "/home/ubuntu/anaconda3/envs/debug/lib/python3.6/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available
Also I found a bug in your code: instead of obj.start_streaming(), it should be obj.start_streaming.remote().
Traceback (most recent call last):
File "test.py", line 4, in <module>
gi.require_version('Gst', '1.0')
AttributeError: module 'gi' has no attribute 'require_version'
I was not able to run pip install gobject PyGObject, it failed with
'pkg-config' not found.
Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']
----------------------------------------
ERROR: Failed building wheel for pycairo
Failed to build PyGObject pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
But I was able to install it via conda conda install -c conda-forge pygobject.
After that, I’m still facing
Traceback (most recent call last):
File "test.py", line 4, in <module>
gi.require_version('Gst', '1.0')
File "/home/ubuntu/anaconda3/envs/debug/lib/python3.6/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available
Hi JJyao,
Please find the complete stacktrace below:
Traceback (most recent call last):
File "/home/kandhavarapu/projects/concor/warehouse/test.py", line 9, in <module>
class GstServer(GstRtspServer.RTSPServer):
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/_private/worker.py", line 2896, in remote
return _make_remote(args[0], {})
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/_private/worker.py", line 2597, in _make_remote
return ray.actor._make_actor(function_or_class, options)
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/actor.py", line 1342, in _make_actor
_inject_tracing_into_class(Class)
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/util/tracing/tracing_helper.py", line 540, in _inject_tracing_into_class
_add_param_to_signature(
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/util/tracing/tracing_helper.py", line 106, in _add_param_to_signature
old_sig = inspect.signature(function)
File "/usr/lib/python3.10/inspect.py", line 3247, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
File "/usr/lib/python3.10/inspect.py", line 2995, in from_callable
return _signature_from_callable(obj, sigcls=cls,
File "/usr/lib/python3.10/inspect.py", line 2558, in _signature_from_callable
raise ValueError('callable {!r} is not supported by signature'.format(obj))
ValueError: callable gi.FunctionInfo(signal_handler_disconnect) is not supported by signature
Traceback (most recent call last):
File "temp.py", line 10, in <module>
class GstServer(GstRtspServer.RTSPServer):
File "/home/bdonga/Documents/Pipeline/ray_env/lib/python3.8/site-packages/ray/worker.py", line 2276, in remote
return _make_remote(args[0], {})
File "/home/bdonga/Documents/Pipeline/ray_env/lib/python3.8/site-packages/ray/worker.py", line 2147, in _make_remote
return ray.actor.make_actor(function_or_class, options)
File "/home/bdonga/Documents/Pipeline/ray_env/lib/python3.8/site-packages/ray/actor.py", line 1251, in make_actor
_inject_tracing_into_class(Class)
File "/home/bdonga/Documents/Pipeline/ray_env/lib/python3.8/site-packages/ray/util/tracing/tracing_helper.py", line 525, in _inject_tracing_into_class
add_param_to_signature(
File "/home/bdonga/Documents/Pipeline/ray_env/lib/python3.8/site-packages/ray/util/tracing/tracing_helper.py", line 102, in add_param_to_signature
old_sig = inspect.signature(function)
File "/usr/lib/python3.8/inspect.py", line 3093, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
File "/usr/lib/python3.8/inspect.py", line 2842, in from_callable
return _signature_from_callable(obj, sigcls=cls,
File "/usr/lib/python3.8/inspect.py", line 2405, in _signature_from_callable
raise ValueError('callable {!r} is not supported by signature'.format(obj))
ValueError: callable gi.FunctionInfo(signal_handler_disconnect) is not supported by signature
Currently Ray requires that each actor method is supported by signature inspection for tracing purpose.
To workaround this, instead of making GstServer a subclass of RTSPServer, could you create a RTSPServer as a class member so GstServer won’t automatically get all the methods from RTSPServer?
We are receiving pickling issues when we make RTSPServer as a class member. Below is the stack trace:
Traceback (most recent call last):
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/_private/function_manager.py", line 461, in export_actor_class
serialized_actor_class = pickle.dumps(Class)
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/cloudpickle/cloudpickle_fast.py", line 73, in dumps
cp.dump(obj)
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/cloudpickle/cloudpickle_fast.py", line 620, in dump
return Pickler.dump(self, obj)
TypeError: cannot pickle 'GLibProxyModule' object
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/kandhavarapu/projects/concor/warehouse/test.py", line 89, in <module>
server = GstServer.remote()
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/actor.py", line 529, in remote
return self._remote(args=args, kwargs=kwargs, **self._default_options)
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/util/tracing/tracing_helper.py", line 387, in _invocation_actor_class_remote_span
return method(self, args, kwargs, *_args, **_kwargs)
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/actor.py", line 844, in _remote
worker.function_actor_manager.export_actor_class(
File "/home/kandhavarapu/.local/lib/python3.10/site-packages/ray/_private/function_manager.py", line 469, in export_actor_class
raise TypeError(msg) from e
TypeError: Could not serialize the actor class test.GstServer.__init__. Check https://docs.ray.io/en/master/ray-core/objects/serialization.html#troubleshooting for more information.