Score:0

Samba module issue when importing. Can import samba, cannot import samba.netcmd

de flag

I've been attempting to use samba-tool on ubuntu 20.04 to no avail. When calling it I get an error telling me that Samba is not a module.

I've tried several clean installs and that hasn't worked. I've looked through the directories and all python modules seem to exist. I'm a bit lost as to how to proceed.

root@xtu-ThinkPad-X250:/# samba-tool
Traceback (most recent call last):
  File "/usr/bin/samba-tool", line 33, in <module>
    from samba.netcmd.main import cmd_sambatool
ModuleNotFoundError: No module named 'samba.netcmd'; 'samba' is not a package

when importing (just) samba in python things work ok.

when importing it the way the module does, I get the same error

Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from samba.netcmd.main import cmd_sambatool
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'samba.netcmd'; 'samba' is not a package
>>> import samba
>>> import samba.netcmd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'samba.netcmd'; 'samba' is not a package
>>> 

guiverc avatar
cn flag
Ubuntu 20? so this is Ubuntu Core 20 or a *snap* only system? Ubuntu products using the *year* format are different products to those using the *year.month* format.
sa flag
Which Samba packages have you installed ?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.