[Zeek] Broker & Python 3

Neslog neslog at gmail.com
Thu Jul 18 08:12:55 PDT 2019


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 "<string>", line 1, in <module>
AttributeError: module 'broker' has no attribute '__file__'

# python3.6 -c 'import broker; print(broker.__file__)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'broker' has no attribute '__file__'

On Wed, Jul 17, 2019 at 5:31 PM Jon Siwek <jsiwek at corelight.com> wrote:

> On Wed, Jul 17, 2019 at 1:54 PM Neslog <neslog at gmail.com> wrote:
> >
> > I just compiled Broker and getting errors with python3x.  Here's the
> output.
> >
> > # python3 -c 'import broker; print(broker.__file__)'
> > Traceback (most recent call last):
> >   File "<string>", line 1, in <module>
> > ModuleNotFoundError: No module named 'broker'
>
> 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:
>
> $ PYTHONPATH=./build/python python3 -c 'import broker;
> print(broker.__file__)'
> /Users/jon
>
> If you're installing as part of Bro/Zeek, it's likely not installed at
> a path where Python will locate it by default:
>
> $ PYTHONPATH=/usr/local/zeek/lib/zeekctl python3 -c 'import broker;
> print(broker.__file__)'
> /usr/local/zeek/lib/zeekctl/broker/__init__.py
>
> 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
>
> - Jon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/zeek/attachments/20190718/37f3741e/attachment.html 


More information about the Zeek mailing list