Check out the below console log Python 2.7.9 (default, Mar 24 2015, 10:47:14) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pysmb Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dynamic module does not define init function (initpysmb) >>> import smb Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named smb >>> ------------------------------------------------------------------------ Probable fix could be change the initsmb function name in source4/libcli/pysmb.c (line 638) to initpysmb
The module name is supposed to be "smb". You can try importing smb module as follows: from samba import smb That's how it is used elsewhere (python/samba/netcmd/gpo.py).
Marking as resolved per Amitay's comment.