Hi,
Starting now to learn about elastalert (and not exactly a Python expert) but when trying to use v0.2.0b2 I get this error:
root@ebs-cybersecurity-alerts:/opt/elastalert# python elastalert/elastalert.py
/usr/local/lib/python2.7/dist-packages/requests-2.21.0-py2.7.egg/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
Traceback (most recent call last):
File "elastalert/elastalert.py", line 21, in
import kibana
File "/opt/elastalert/elastalert/kibana.py", line 5, in
from util import EAException
File "/opt/elastalert/elastalert/util.py", line 13, in
from . import ElasticSearchClient
ValueError: Attempted relative import in non-package
I did a pip install of elasticsearch library 7.0.0
the setup.py install didn't return any errors. This is Ubuntu 19.04.
Thanks,
Alex
Try python -m elastalert.elastalert instead of python elastalert/elastalert.py
Hi,
I am having this issue when i want to run elastalert
python3.4 -m elastalert.elastalert --verbose --rule ../example_rules/login_success.yaml
Traceback (most recent call last):
File "/usr/lib64/python3.4/runpy.py", line 151, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name)
File "/usr/lib64/python3.4/runpy.py", line 104, in _get_module_details
spec = importlib.util.find_spec(mod_name)
File "/usr/lib64/python3.4/importlib/util.py", line 86, in find_spec
parent = __import__(parent_name, fromlist=['__path__'])
File "/root/elastalert/elastalert/elastalert.py", line 29, in
from . import kibana
SystemError: Parent module '' not loaded, cannot perform relative import
Can you assist?
This might be a Python3.4 issue, could you try 3.5 and see if you get the same error?
Can you try this: https://github.com/Yelp/elastalert/issues/2417#issuecomment-523985317
Most helpful comment
Try
python -m elastalert.elastalertinstead ofpython elastalert/elastalert.py