Bug 11181 - import pysmb causes python ImportError
import pysmb causes python ImportError
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python
4.1.17
All All
: P3 normal
: ---
Assigned To: Amitay Isaacs
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-03-27 09:26 UTC by Nagendra.V.S
Modified: 2015-08-19 01:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nagendra.V.S 2015-03-27 09:26:42 UTC
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
Comment 1 Amitay Isaacs 2015-08-19 01:34:05 UTC
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).