How to fix "ImportError: No module named error" - elastalert

I installed elastalert from git clone https://github.com/Yelp/elastalert.git and integrated with slack tool but when I try to run elastalert using command python -m elastalert.elastalert --verbose --rule example_frequency.yaml I am getting this error:
Traceback (most recent call last):
File "runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/elastalert-0.2.1-py2.7.egg/elastalert/elastalert.py", line 29, in <module>
from . import kibana
File "/usr/local/lib/python2.7/dist-packages/elastalert-0.2.1-py2.7.egg/elastalert/kibana.py", line 4, in <module>
import urllib.error
ImportError: No module named error
I expect output of getting alerts in slack tool

I just have the same problem. I used python 2.7 to install elastalert.
So I remove elastalert and reinstall it with python36
pip uninstall elastalert
sudo yum install python36 gcc python36-devel -y
sudo yum install python36-setuptools -y
sudo easy_install-3.6 pip
cd elastalert/
pip3.6 install "setuptools>=11.3"
python3.6 setup.py install
pip3.6 install -r requirements.txt
pip3.6 install elastalert
python36 -m elastalert.elastalert
Hope useful for you or someone that need

Related

Jenkins : Pycharm : I keep getting a message to upgrade pip

Im trying to run automated test on jenkins cloud version : so i get this error :
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-0739wibs/cryptography/setup.py", line 14, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0739wibs/cryptography/
You are using pip version 9.0.3, however version 22.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Import chromedriver on the env variable.
Import python path on the env variable.
/tmp/jenkins3940904514869226010.sh: line 16: pytest: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I do `python3 -m pip install --upgrade pip
I get Requirement already satisfied: pip in ./venv/lib/python3.8/site-packages (22.0.3)
`
I have fixed it by adding this line on Execute shell
pip3 install --upgrade pip

Getting import error while installing odoo 15

Traceback (most recent call last):
File "/opt/odoo151/odoo/odoo/service/server.py", line 1196, in load_server_wide_modules
odoo.modules.module.load_openerp_module(m)
File "/opt/odoo151/odoo/odoo/modules/module.py", line 396, in load_openerp_module
__import__('odoo.addons.' + module_name)
File "/opt/odoo151/odoo/odoo/addons/base/__init__.py", line 5, in <module>
from . import models
File "/opt/odoo151/odoo/odoo/addons/base/models/__init__.py", line 23, in <module>
from . import ir_mail_server
File "/opt/odoo151/odoo/odoo/addons/base/models/ir_mail_server.py", line 23, in <module>
from urllib3.contrib.pyopenssl import PyOpenSSLContext
File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 62, in <module>
from ..packages import six
ImportError: cannot import name 'six'
I was getting above error while trying to install odoo 15
I have already tried this command for installing six package->
sudo apt-
get install python-six
..but getting same error again and again even after installing 'six' package.
Try to install six packages
pip3 install six
OR
pip install six
It would be helpful if you updated urllib3. After upgrading urllib, I was able to resolve this. Please try it once:
sudo pip3 install urllib3 --upgrade
Try following command:
sudo -H pip3 install firebase_admin pyOpenSSL
You can try the following commands from inside your odoo directoty.
sudo pip3 install -r requirements.txt

Install odoo8.0 on Mac OSX 10.11,I got error "unsafe use of relative rpath libpq.5.dylib"

I have downloaded Odoo 8.0 from git ,all my steps:
python --version
Python 2.7.10
Installed PostgresApp into Applications and executed
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
Installed pip
sudo easy_install pip
Finished processing dependencies for pip
and installed homebrew and Xcode-select
Installed other libs
brew install autoconf automake libtool
brew install libxml2 libxslt libevent
Installed Python dependencies
`sudo easy_install -U setuptools
Finished processing dependencies for setuptools
cd odoo/
sudo pip install --user -r requirements.txt
Successfully installed Mako-1.0.1 Pillow-2.7.0 Werkzeug-0.9.6 `
Running odoo
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
./odoo.py --addons-path=addons --db-filter=mydb
And i got this error:
Traceback (most recent call last):
File "./odoo.py", line 160, in <module>
main()
File "./odoo.py", line 156, in main
import openerp
File "/Users/Charlie/Desktop/Python_Workspace/odoo-8.0/openerp/__init__.py", line 76, in <module>
import modules
File "/Users/Charlie/Desktop/Python_Workspace/odoo-8.0/openerp/modules/__init__.py", line 27, in <module>
from . import db, graph, loading, migration, module, registry
File "/Users/Charlie/Desktop/Python_Workspace/odoo-8.0/openerp/modules/graph.py", line 32, in <module>
import openerp.osv as osv
File "/Users/Charlie/Desktop/Python_Workspace/odoo-8.0/openerp/osv/__init__.py", line 22, in <module>
import osv
File "/Users/Charlie/Desktop/Python_Workspace/odoo-8.0/openerp/osv/osv.py", line 23, in <module>
from .orm import Model, TransientModel, AbstractModel
File "/Users/Charlie/Desktop/Python_Workspace/odoo-8.0/openerp/osv/orm.py", line 5, in <module>
from ..models import (
File "/Users/Charlie/Desktop/Python_Workspace/odoo-8.0/openerp/models.py", line 56, in <module>
import psycopg2
File "/Library/Python/2.7/site-packages/psycopg2-2.6.2-py2.7-macosx-10.11-intel.egg/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.7/site-packages/psycopg2-2.6.2-py2.7-macosx-10.11-intel.egg/psycopg2/_psycopg.so, 2): Library not loaded: libpq.5.dylib
Referenced from: /Library/Python/2.7/site-packages/psycopg2-2.6.2-py2.7-macosx-10.11-intel.egg/psycopg2/_psycopg.so
Reason: unsafe use of relative rpath libpq.5.dylib in /Library/Python/2.7/site-packages/psycopg2-2.6.2-py2.7-macosx-10.11-intel.egg/psycopg2/_psycopg.so with restricted binary
I have worked on this about two days.Thanks a lot.

Installing ODOO8 (OPENERP)

I would like to install Odoo 8 (OpenERP) on my Ubuntu 14.04 system I had to follow a tutorial to install Odoo but when I run this command it shows me these errors:
root#Nema:/# su odoo
odoo#Nema:/$ openerp-server
Traceback (most recent call last):
File "/usr/local/bin/openerp-server", line 4, in <module>
import pkg_resources
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: qrcode
odoo#Nema:/$
how to solve this problem
Help me please ??
You're missing a library. Install it with pip, apt-get or any other way to install a package.
You'll probably need sudo to install the package.
apt-get
apt-get install python-qrcode
pip
pip install qrcode

Install matplotlib with Plone 4.3.3 via buildout [duplicate]

When I try to upgrade my matplotlib using pip, it outputs:
Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745feac1a30b210940c
Downloading matplotlib-1.4.0.tar.gz (51.2MB): 51.2MB downloaded
Running setup.py (path:/tmp/pip_build_root/matplotlib/setup.py) egg_info for package matplotlib
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.4.0]
python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC
4.8.2]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.2]
six: yes [using six version 1.7.3]
dateutil: yes [using dateutil version 2.2]
tornado: yes [using tornado version 4.0.1]
pyparsing: yes [using pyparsing version 2.0.2]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
result = package.check()
File "setupext.py", line 940, in check
if 'No such file or directory\ngrep:' in version:
TypeError: argument of type 'NoneType' is not iterable
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.4.0]
python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC
4.8.2]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.2]
six: yes [using six version 1.7.3]
dateutil: yes [using dateutil version 2.2]
tornado: yes [using tornado version 4.0.1]
pyparsing: yes [using pyparsing version 2.0.2]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
result = package.check()
File "setupext.py", line 940, in check
if 'No such file or directory\ngrep:' in version:
TypeError: argument of type 'NoneType' is not iterable
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/username/.pip/pip.log
In the tail of the log it says:
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Why did it fail?
Many thanks!
This is a known bug that has been fixed (https://github.com/matplotlib/matplotlib/pull/3414) on master.
The bug is in the handling of searching for a freetype installation. If you install the Linux package freetype-dev, you will avoid this bug and be able to compile matplotlib.
sudo apt-get install libfreetype6-dev
On Ubuntu 14 server, you also need to install libxft-dev
sudo apt-get install libfreetype6-dev libxft-dev
I had the same issues trying to install matplotlib on Python 3 using pip3, and it seems that this problem is related to a bare-bones installation of Python 3, and doing a:
sudo apt-get build-dep matplotlib
followed by
sudo pip3 install matplotlib
is probably a better solution than selectively installing only the libraries related to matplotlib.
Since mac doesn't have apt-get you, on OSX you may need to do:
brew install freetype
then you can run:
pip install matplotlib
Found this page while looking answer for fedora 24.
RPM solution is:
dnf install freetype-devel
If you re running Ubuntu server 14.04 u should add this font dependency
sudo apt-get install libxft-dev
Source
I was trying too update directly using sudo pip but changes are not saved in last. So i first use update cmd in terminal:
sudo apt-get update
then i used sudo install:
sudo apt-get install libffi-dev
Finally its installed by doing this method.
For those on Fedora 25 hitting this thread, I needed these two packages to make it work:
sudo dnf install freetype-devel gcc-c++
This worked for me:
python -m pip install -U pip setuptools
python -m pip install matplotlib
For more details, follow : https://matplotlib.org/2.0.0/users/installing.html