>
According to the Python docs [0], dl only works with a number of
conditions:
Note: This module will not work unless sizeof(int) == sizeof(long) ==
sizeof(char *) If this is not the case, SystemError will be raised on
import.
If you run this program on an amd64 machine:
$ cat sizes.c
#include <stdio.h>
int main(void) {
printf("int: %d; long: %d; char *: %d\n", sizeof(int), sizeof(long),
sizeof(char *));
return 0;
}
This is what you get:
$ ./a.out
int: 4; long: 8; char *: 8
So, the answer is that the dl module will not work on amd64. The
recommended fix would then be to not use dl, since it is an ugly hack
(as is any foreign function interface) and instead write proper Python
bindings for whatever library you are trying to access.