Re: Broker & Python 3

Neslog <[email protected]>
Newsgroups gmane.comp.security.detection.bro
Message-ID <CALgfRGLJ+KPiNb+nW24odE4mSBKDvPX-NZfiifX5w84UndHaXQ@mail.gmail.com>
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 <[email protected]> wrote:

> On Wed, Jul 17, 2019 at 1:54 PM Neslog <[email protected]> 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
>

_______________________________________________
Zeek mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/zeek
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.