Airflow extra Packages failed to install due to mysqlclient - python

I have instaled basic version of Airflow which uses Sqlite as metastore. Now i am trying to install other Packages.
I tried the below Packages but failed with mysqlclient issue.
pip install apache-airflow[devel]
Error message with compile statement as below,
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Dversion_info=(1,3,14,'final',0) -D__version__=1.3.14 -I/usr/include/mysql -I/opt/python-2.7.15/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX -DUNIV_LINUX
_mysql.c:29:19: error: mysql.h: No such file or directory
_mysql.c:30:26: error: mysqld_error.h: No such file or directory
_mysql.c:48:20: error: errmsg.h: No such file or directory
_mysql.c:67: error: expected specifier-qualifier-list before ‘MYSQL’
Final Failure Command in log:
Command "/home/usr/Airflow_Workspace/install/bin/python -u -c "import
setuptools,
tokenize;file='/tmp/pip-install-yeFo2f/mysqlclient/setup.py';f=getattr(tokenize,
'open', open)(file);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, file, 'exec'))" install
--record /tmp/pip-record-Bw_HED/install-record.txt --single-version-externally-managed --compile --install-headers /home/usr/Airflow_Workspace/install/include/site/python2.7/mysqlclient"
failed with error code 1 in /tmp/pip-install-yeFo2f/mysqlclient/
I tried installing many dependency for python but still not resolved. Could someone help me what exactly I am missing.

If you're on Ubuntu/Debian, you need the libmysqlclient-dev system package first.
sudo apt install libmysqlclient-dev

Related

Using pip to install package in AWS

I am new to using Python packages, and I am trying to install a package called RSeQC into a Linux AWS instance.
I started by running:
sudo yum install python3-pip
then running:
sudo yum install python3-devel
and Finally:
sudo pip3 install RSeQC
However, I get the following long error:
compilation terminated.
In file included from libBigWig/bwWrite.c:6:0:
libBigWig/bigWig.h:4:10: fatal error: zlib.h: No such file or directory
#include <zlib.h>
^~~~~~~~
compilation terminated.
error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DNOCURL -DWITHNUMPY -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -IlibBigWig -I/usr/include/python3.7m -I/usr/local/lib64/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c pyBigWig.c -o build/temp.linux-x86_64-3.7/pyBigWig.o" failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-
kv90ovvh/pyBigWig/setup.py';f=getattr(tokenize, 'open', open).
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__,
'exec'))" install --record /tmp/pip-smel45e_-record/install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in /tmp/pip-build-kv90ovvh/pyBigWig/
Would greatly appreciate any advice in debugging this as I am stumped. Thanks in advance!

install pycrypto on python3.6

I am running Centos7 with Python 3.6. I am trying to install pycrypto with the command "pip3 install pycrypto". I also installed the dev tools, so gcc is installed. I am getting the following output.
What am I missing?
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash._MD2' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.6m -c src/MD2.c -o build/temp.linux-x86_64-3.6/src/MD2.o
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h6pl3s2f/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-9fjag3e5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-h6pl3s2f/pycrypto/
That did not work, but I did find the answer in the article.
I ran "yum -y install python3-devel" and this fixed my issue. I was then able to install pycrypto.
I also had the same issue for CentOS.
However, it turned out I was missing one of the dependencies.
sudo yum install gcc
sudo yum install gcc-c++
sudo yum install python-devel
sudo pip install pycrypto

sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory

I have OS
Red Hat Enterprise Linux Server release 7.4 (Maipo)
and python
Python 2.7.13 :: Anaconda 4.4.0 (64-bit)
Tried to install lib sasl
sudo pip install sasl
Collecting sasl
Downloading http://repo.com/api/pypi/pypi/packages/8e/2c/45dae93d666aea8492678499e0999269b4e55f1829b1e4de5b8204706ad9/sasl-0.2.1.tar.gz
Collecting six (from sasl)
Downloading http://repo.com/api/pypi/pypi/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, sasl
building 'sasl.saslwrapper' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/sasl
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Isasl -I/usr/include/python2.7 -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-2.7/sasl/saslwrapper.o
In file included from sasl/saslwrapper.cpp:254:0:
sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory
#include <sasl/sasl.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Ym7ZOA/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_8ahws-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Ym7ZOA/sasl/
How solve this problem?
if you are on AWS EC2/EMR or CentOS, sudo yum install cyrus-sasl-devel
From this issue, it seems that you need the libsasl2.
You can install libsasl2 by using the command :-
sudo apt-get install libsasl2-dev

Error while intalling request_kerberos package

I do not understand what the problem is and how to solve it. When I execute
pip install --upgrade pip
And what I obtained is
Collecting pykerberos
Using cached pykerberos-1.1.14.tar.gz
Installing collected packages: pykerberos
Running setup.py install for pykerberos ... error
Complete output from command /usr/bin/python2 -u -c "import
setuptools, tokenize;__file__='/tmp/pip-build-
tlTKls/pykerberos/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record
/tmp/pip-cFs8JW-record/install-record.txt --single-version-externally-
managed --compile:
running install
running build
running build_ext
building 'kerberos' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-
D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-
buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE
-fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -
fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -
grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -
fPIC -I/usr/include/python2.7 -c src/kerberos.c -o build/temp.linux-
x86_64-2.7/src/kerberos.o -DGSSAPI_EXT
src/kerberos.c:17:20: error fatal: Python.h: No existe el fichero
o el directorio
#include <Python.h>
^
compilación terminada.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools,
tokenize;__file__='/tmp/pip-build-
tlTKls/pykerberos/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --
record /tmp/pip-cFs8JW-record/install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in /tmp/pip-
build-tlTKls/pykerberos/
I am installing this because I am trying to run kerberos to use it to authenticate when connecting through ansible. Request_kerberos is a dependency.
Any idea?
Thanks!!

Building Python kerberos extension on opensuse fails

I am trying to build kerberos on opensuse 13.2 inside a docker container. I have already installed the required libraries:
bash-4.2# cat /etc/os-release
NAME=openSUSE
VERSION="13.2 (Harlequin)"
VERSION_ID="13.2"
PRETTY_NAME="openSUSE 13.2 (Harlequin) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:13.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"
bash-4.2#
bash-4.2# zypper search --installed krb5
S | Name | Summary | Type
--+------------+---------------------------------------------+--------
i | krb5 | MIT Kerberos5 Implementation--Libraries | package
i | krb5-devel | MIT Kerberos5 - Include Files and Libraries | package
bash-4.2# pip install kerberos
Downloading/unpacking kerberos
Downloading kerberos-1.2.3.tar.gz
Running setup.py (path:/tmp/pip_build_root/kerberos/setup.py) egg_info for package kerberos
Installing collected packages: kerberos
Running setup.py install for kerberos
building 'kerberos' extension
gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -I/usr/include/python2.7 -c src/base64.c -o build/temp.linux-x86_64-2.7/src/base64.o sh: krb5-config: command not found
gcc: error: sh:: No such file or directory
gcc: error: krb5-config:: No such file or directory
gcc: error: command: No such file or directory
gcc: error: not: No such file or directory
gcc: error: found: No such file or directory
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/kerberos/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8u80ki-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'kerberos' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -I/usr/include/python2.7 -c src/base64.c -o build/temp.linux-x86_64-2.7/src/base64.o sh: krb5-config: command not found
gcc: error: sh:: No such file or directory
gcc: error: krb5-config:: No such file or directory
gcc: error: command: No such file or directory
gcc: error: not: No such file or directory
gcc: error: found: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/kerberos/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8u80ki-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/kerberos
Storing debug log for failure in /root/.pip/pip.log
I tried various things such as finding krb5-config or other krb5 libraries. But, on openSUSE everything is inside krb5-devel package. Do you have any pointers?
My core intention is to build Ansible Windows support on openSUSE
Python kerberos package seems to be difficult to compile, this could be at least a temporary workaround
pip install kerberos==1.1.1
Later versions seem to miss required header files, so there might be some packaging problem.
Try 1.2.4; not sure what went wrong with the headers in 1.2.3 but they are there in 1.2.4.

Categories

Resources