Building Python kerberos extension on opensuse fails - python

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.

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

Airflow extra Packages failed to install due to mysqlclient

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

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!!

Build errors when trying to install pylibmc

Just got a new laptop, setting up my dev environment from scratch, and I'm getting this weird error that doesn't seem to be a result of missing dependencies (though I could be wrong). I'm working in a virtualenv with Python 2.7.3. Libevent, libmemcached and memcached were all installed with Homebrew earlier.
(grlli)Tylers-MacBook-Pro:grlli tyler$ pip install pylibmc
Downloading/unpacking pylibmc
Running setup.py egg_info for package pylibmc
Installing collected packages: pylibmc
Running setup.py install for pylibmc
building '_pylibmc' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_ZLIB -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _pylibmcmodule.c -o build/temp.macosx-10.8-intel-2.7/_pylibmcmodule.o -fno-strict-aliasing
_pylibmcmodule.c:1895:33: error: member reference base type 'const void' is not a structure or union
svr->hostname, svr->port);
~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
1 error generated.
error: command 'cc' failed with exit status 1
Complete output from command /Users/tyler/projects/envs/grlli/bin/python -c "import setuptools;__file__='/Users/tyler/projects/envs/grlli/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1_/jkd0_x495gs0g8v7z2pgz3bc0000gn/T/pip-E_pLFk-record/install-record.txt --single-version-externally-managed --install-headers /Users/tyler/projects/envs/grlli/bin/../include/site/python2.7:
running install
running build
running build_py
running build_ext
building '_pylibmc' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -I/usr/local/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_ZLIB -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _pylibmcmodule.c -o build/temp.macosx-10.8-intel-2.7/_pylibmcmodule.o -fno-strict-aliasing
_pylibmcmodule.c:1895:33: error: member reference base type 'const void' is not a structure or union
svr->hostname, svr->port);
~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command /Users/tyler/projects/envs/grlli/bin/python -c "import setuptools;__file__='/Users/tyler/projects/envs/grlli/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1_/jkd0_x495gs0g8v7z2pgz3bc0000gn/T/pip-E_pLFk-record/install-record.txt --single-version-externally-managed --install-headers /Users/tyler/projects/envs/grlli/bin/../include/site/python2.7 failed with error code 1 in /Users/tyler/projects/envs/grlli/build/pylibmc
Storing complete log in /Users/tyler/.pip/pip.log
Any help is greatly appreciated!
I ran into the same issue. The one thing that fixed it for me was updating setuptools to the latest version.
pip install setuptools --upgrade
Try to install pylibmc 1.2.3, it helped me.

Categories

Resources