If you run 'samba-tool -V' it returns 'samba-tool: no such subcommand: -V' '-V' is a valid subcommand The fix is: in samba/netcmd/__init__.py at line 352, replace: continue With: return (self, deferred_args) Without the 'return' it falls down into: # We didn't find a subcommand, but maybe we found e.g. --version print("%s: missing subcommand\n" % (path), file=self.outf) return (self, deferred_args) There is probably a better way of fixing it, but it works for me.