cdsutils --help raises ValueError if pygobject installed but not gst-python
The command cdsutils --help
raises a ValueError
when pygobject
is installed (meaning you can import gi
) but gst-python
isn't:
$ conda create -n test -y -q python=3.9 cdsutils=1.4.2 pygobject
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
... etc ...
$ conda activate test
$ cdsutils --help
usage: cdsutils <cmd> <args>
Advanced LIGO Control Room Utilites
Available commands:
read read EPICS channel value
write write EPICS channel value
switch read/switch buttons in filter module
sfm decode/encode filter module switch values
step step EPICS channels over specified range
servo servo EPICS channel with simple integrator (pole at zero)
trigservo servo EPICS channel with trigger
avg average one or more NDS channels
Traceback (most recent call last):
File "/home/duncan/opt/miniconda3/envs/test/bin/cdsutils", line 10, in <module>
sys.exit(main())
File "/home/duncan/opt/miniconda3/envs/test/lib/python3.9/site-packages/cdsutils/__main__.py", line 40, in main
usage()
File "/home/duncan/opt/miniconda3/envs/test/lib/python3.9/site-packages/cdsutils/__main__.py", line 23, in usage
mod = importlib.import_module('.'+cmd, package='cdsutils')
File "/home/duncan/opt/miniconda3/envs/test/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/duncan/opt/miniconda3/envs/test/lib/python3.9/site-packages/cdsutils/audio.py", line 8, in <module>
gi.require_version('Gst', '1.0')
File "/home/duncan/opt/miniconda3/envs/test/lib/python3.9/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available
$ conda install -y -q gst-python
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /home/duncan/opt/miniconda3/envs/test
added / updated specs:
- gst-python
The following NEW packages will be INSTALLED:
gst-plugins-base conda-forge/linux-64::gst-plugins-base-1.18.3-h04508c2_0
gst-python conda-forge/linux-64::gst-python-1.18.3-py39hc345959_0
gstreamer conda-forge/linux-64::gstreamer-1.18.3-h3560a44_0
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
$ cdsutils --help
usage: cdsutils <cmd> <args>
Advanced LIGO Control Room Utilites
Available commands:
read read EPICS channel value
write write EPICS channel value
switch read/switch buttons in filter module
sfm decode/encode filter module switch values
step step EPICS channels over specified range
servo servo EPICS channel with simple integrator (pole at zero)
trigservo servo EPICS channel with trigger
avg average one or more NDS channels
/home/duncan/opt/miniconda3/envs/test/lib/python3.9/site-packages/cdsutils/audio.py:10: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
GObject.threads_init()
audio play NDS channel as audio stream
water NOT SUPPORTED: No module named 'sip'
version print version info and exit
help this help
Add '-h' after individual commands for command help.
I don't know if this is just a weird situation that is 'user error', but maybe worth patching just in case.