I encountered this while running python code with opencv and pyqt5

I have an error running python code containing opencv and pyqt5. pyqt5’s ui turns gray when the program runs and an error is reported. The details are as follows:
(python3:7640): GLib-GObject-WARNING **: 21:55:41.647: cannot register existing type ‘GdkDisplayManager’

(python3:7640): GLib-CRITICAL **: 21:55:41.647: g_once_init_leave: assertion ‘result != 0’ failed

(python3:7640): GLib-GObject-CRITICAL **: 21:55:41.647: g_object_new_with_properties: assertion ‘G_TYPE_IS_OBJECT (object_type)’ failed

(python3:7640): GLib-GObject-WARNING **: 21:55:41.647: invalid (NULL) pointer instance

(python3:7640): GLib-GObject-CRITICAL **: 21:55:41.648: g_signal_connect_data: assertion ‘G_TYPE_CHECK_INSTANCE (instance)’ failed

(python3:7640): GLib-GObject-WARNING **: 21:55:41.648: invalid (NULL) pointer instance

(python3:7640): GLib-GObject-CRITICAL **: 21:55:41.648: g_signal_connect_data: assertion ‘G_TYPE_CHECK_INSTANCE (instance)’ failed

(python3:7640): GLib-GObject-WARNING **: 21:55:41.743: cannot register existing type ‘GdkDisplay’

(python3:7640): GLib-CRITICAL **: 21:55:41.743: g_once_init_leave: assertion ‘result != 0’ failed

(python3:7640): GLib-GObject-CRITICAL **: 21:55:41.744: g_type_register_static: assertion ‘parent_type > 0’ failed

(python3:7640): GLib-CRITICAL **: 21:55:41.744: g_once_init_leave: assertion ‘result != 0’ failed

(python3:7640): GLib-GObject-CRITICAL **: 21:55:41.744: g_object_new_with_properties: assertion ‘G_TYPE_IS_OBJECT (object_type)’ failed
Segmentation fault (core dumped)

my .bashrc:
export OPENBLAS_CORETYPE=ARMV8
SWIG_PATH=/urs/local/share/swig/3.0.12
PATH=$PATH:$SWIG_PATH
export PYTHONPATH=$PYTHONPATH:/usr/local/lib:/usr/local/lib/python3.6/pyrealsense2

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export DISPLAY=:0.0

my .profile:
export QT_QPA_PLATFORMTHEME=gtk2

The problem was never solved.

Hi

Could you please replace the display from 0.0 to 0 and try it again?

export DISPLAY=:0

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.