samba-tool ImportError: No module named param

Alexander Bokovoy ab at
Wed Dec 12 17:00:14 UTC 2018

On ke, 12 joulu 2018, Volker Lendecke via samba-technical wrote:
> On Wed, Dec 12, 2018 at 03:49:46PM +0000, Noel Power via samba-technical wrote:
> > 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
> The python community really was smoking weird stuff when designing a
> completely new and incompatible language, naming it the same as the
> one before.
> We must force the user to choose either python2 or python3 at build
> time and not even pretend to do anything else. If the default "python"
> is python2, just don't do any attempt to even use or build for
> python3. If "python" runs python3, do the reverse. No mix up. At all.
> We should make a blocker bug for 4.10. We can't ship with this mess.
+1. Effectively, this is what we choose to do in Fedora and RHEL as well
for all projects I'm involved with -- we choose at build time which
Python version the product is going to use by default. This way FreeIPA
is using Python 3 in Fedora 29 but Samba AD DC binaries are using Python
2 (and ship Python 3 libraries in addition to that). 

And RHEL IdM is running with /usr/libexec/platform-python on RHEL 8 beta
(that is Python 3.6 with no /usr/bin/python predefined so that customers
can choose what /usr/bin/python is for them via python2 or python3

Actual solution is to do a rewrite of shebangs to the specific version
we expect to work with.

/ Alexander Bokovoy

More information about the samba-technical mailing list