Segmentation Fault (Core Dumped)

I am trying to run Carla-simulator 0.9.10-1
I have successfully installed it in OPT folder and now want to run the example script spawn_npc.py
however, every time I run the script, it shows me the Segmentation Fault (Core Dumped) error.
I tried to use carla by make launch method also but still getting the same error.
I am able to get the build to run successfully by make launch method and the ./CarlaUE4.sh -opengl method also but when I try to run any examples then I get the same error.
Please help me I am very new to Carla and using it for the first time.
This is the message from logs:
python3[13596]: segfault at 10 ip 00007fe88a2322b9 sp 00007ffc28f73630 error 4 in libapt-pkg.so.5.0.2[7fe88a17c000+1b6000]