gcc -shared -o test.so -fPIC test.c Then try to launch test_c.py with matplotlib commented or not: python3 test_c.py