samba-tool ImportError: No module named param

Noel Power nopower at suse.com
Wed Dec 12 15:49:46 UTC 2018


On 12/12/2018 15:34, Björn Baumbach via samba-technical wrote:
> Hi!
>
> It seems that there is something broken with the python changes in
> current master.
>
> I've just checked out current master, cleaned the checkout, configured
> with configure.developer, make && make install && make and have the
> following result on different systems:
>
> # ./bin/samba-tool domain provision ...
> Traceback (most recent call last):
>    File "./bin/samba-tool", line 33, in <module>
>      from samba.netcmd.main import cmd_sambatool
>    File "bin/python/samba/__init__.py", line 29, in <module>
>      import samba.param
> ImportError: No module named param

the default make builds and installs python3 products, the import 
statement if failing because you are running ./bin/samba-tool (which by 
default on your system is running with python2 because of the shebang)

if you run python3 ./bin/samba-tool  it will work

So, why haven't we changed the shebang to python3, there is currently 
some discussion ongoing about that. It's not as clear cut as you think. 
In general though scripts that are deliberately written to run with 
python2 & python3 can have python in the shebang line. You need to be 
aware what /usr/bin/python (or wherever it is located) is pointing at, 
in a system that has python2 and python3 it might be /usr/bin/python 
could be a link to either (and certainly in some newer enterprise 
focused distros I will bet soon python -> python3), additionally you 
need to be aware of what your build targets python2 or python3

hth

Noel




More information about the samba-technical mailing list