That error is saying Python can't locate the broker module, so the
general thing you need to do is figure out why it can't locate it.
First thing to check would be if the Python bindings are being built
at all. Does the summary of ./configure say "Python bindings: yes" ?
If they're built, then it also depends on whether you're installing it
or trying to run from the build directory ? If you're installing it,
are you doing it as part of a Bro/Zeek install or separately on its
own ?
If you're not installing, then you need to tell Python where to locate
it within the build directory:
If you're installing Broker by itself, then it may choose a standard
place where it will be located by Python by default (e.g.
site-packages), but really depends on your system and how Broker is
configured, so might help to get more details from the output of your
./configure
Broker was installed with Bro. Python wasn’t working so it was installed via source also. Python 2.7 bindings was installed in the right place. But Python3.6 didn’t install right. I’m not seeing broker in any python3.x folder.
python2.7 -c ‘import broker; print(broker.file)’
/usr/lib/python2.7/dist-packages/broker/init.pyc
python2 -c ‘import broker; print(broker.file)’
/usr/lib/python2.7/dist-packages/broker/init.pyc
python3 -c ‘import broker; print(broker.file)’
Traceback (most recent call last):
File “”, line 1, in
AttributeError: module ‘broker’ has no attribute ‘file’
python3.6 -c ‘import broker; print(broker.file)’
Traceback (most recent call last):
File “”, line 1, in
AttributeError: module ‘broker’ has no attribute ‘file’
Any given build/install of Broker only picks a single version of
Python for which to provide bindings. The output of ./configure tells
you which one (likely whatever is first in your PATH). There's also
the --with-python= and --with-python-config options if you need them.