pypy3 install Cryptography failed - linux

I tried to install Cryptography through:
lsn#lsn-Super-Server:~/pypy/pypy3-v6.0.0-linux64/bin$ ./pypy3 -m pip install PyMySQL
But, it failed with the comments:
running egg_info
writing src/cryptography.egg-info/PKG-INFO
writing dependency_links to src/cryptography.egg-info/dependency_links.txt
writing requirements to src/cryptography.egg-info/requires.txt
writing top-level names to src/cryptography.egg-info/top_level.txt
reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*' found under directory 'vectors'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.5/_padding.c'
creating build/temp.linux-x86_64-3.5
generating cffi module 'build/temp.linux-x86_64-3.5/_constant_time.c'
generating cffi module 'build/temp.linux-x86_64-3.5/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-3.5/build
creating build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5
cc -pthread -DNDEBUG -O2 -Qunused-arguments -fPIC -I/home/lsn/pypy/pypy3-v6.0.0-linux64/include -c build/temp.linux-x86_64-3.5/_openssl.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/_openssl.o -Wconversion -Wno-error=sign-conversion
cc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’?
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/home/lsn/pypy/pypy3-v6.0.0-linux64/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-87db0m7x/Cryptography/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-9zd03ixf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-87db0m7x/Cryptography/

I faced the same error while installing paypalrestsdk for python3 and I found the solution that needs to install or update python-openssl for that.
Try below commands, it's working for me.
For python2
sudo apt-get install python-openssl
For python3
sudo apt-get install python3-openssl
Hope it works for you too.

Related

fatal error: openjpeg.h: No such file or directory

I'm trying to install OpenCV4 on Debian 10 server. I followed the official docs , but compiling I get
In file included from /root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.cpp:10:
/root/opencv/modules/imgcodecs/src/grfmt_jpeg2000_openjpeg.hpp:13:10: fatal error: openjpeg.h: No such file or directory
#include <openjpeg.h>
^~~~~~~~~~~~
compilation terminated.
I installed openjpeg separately from source (this guide)
But it did not help.
I also tried to install opencv4 using pip3 install opencv-python but again, I failed:
An error occurred while building with CMake.
Command:
cmake --build . --target install --config Release --
Install target:
install
Source directory:
/tmp/pip-install-58cut84q/cmake
Working directory:
/tmp/pip-install-58cut84q/cmake/_skbuild/linux-x86_64-3.7/cmake-build
Please check the install target is valid and see CMake's output for more information.
---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools,
tokenize;file='/tmp/pip-install-58cut84q/cmake/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-wvupk349/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-uyj03w3k --compile" failed with error code 1 in
/tmp/pip-install-58cut84q/cmake/
So I'm left clueless and appreciate your help.

Can't install pycrypto under python3 (using pip3) but it is installed under python[2] in parallel

I have both Python 2 and 3 installed in parallel on Ubuntu 18.04.1:
#uname -a
Linux mysvr-1 5.4.0-65-generic #73~18.04.1-Ubuntu SMP Tue Jan 19 09:02:24 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
#python --version
Python 2.7.17
#python3 --version
Python 3.8.8
I am trying to run a script written for Python2 (and which uses simple-crypt which calls pycrypto) using python3 but I cannot install simple-crypt under python3 (pip3) because pycrypto install fails, even though they are both installed fine under python2.
I see the follow errors during install:
#python3 -m pip install simple-crypt
Collecting simple-crypt
Using cached simple-crypt-4.1.7.tar.gz (10 kB)
Collecting pycrypto
Using cached pycrypto-2.6.1.tar.gz (446 kB)
Building wheels for collected packages: simple-crypt, pycrypto
Building wheel for simple-crypt (setup.py) ... done
Created wheel for simple-crypt: filename=simple_crypt-4.1.7-py3-none-any.whl size=8933 sha256=35465628dbc2d4671aef879ccd6d24d09e01ca11afa173fd8d62c5cbcfb8e05b
Stored in directory: /root/.cache/pip/wheels/7f/0b/04/30775cf18395f400fba1112955512e434a896bc5f0592eaf82
Building wheel for pycrypto (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-31add99g
cwd: /tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/
Complete output (215 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/Crypto
copying lib/Crypto/pct_warnings.py -> build/lib.linux-x86_64-3.8/Crypto
...
<...many other lines of copying and creating...>
...
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... yes
...
<...many other successful checks...>
...
checking for memset... yes
configure: creating ./config.status
config.status: creating src/config.h
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash._MD2' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -fwrapv -Wall -fstack-protector-strong -Wformat -Werror=format-security -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.8 -c src/MD2.c -o build/temp.linux-x86_64-3.8/src/MD2.o
src/MD2.c:31:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pycrypto
Running setup.py clean for pycrypto
Successfully built simple-crypt
Failed to build pycrypto
Installing collected packages: pycrypto, simple-crypt
Running setup.py install for pycrypto ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/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-zy55j0yw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pycrypto
cwd: /tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/
Complete output (160 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
...
<...many other lines of copying and creating...>
...
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
running build_configure
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash._MD2' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -fwrapv -Wall -fstack-protector-strong -Wformat -Werror=format-security -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.8 -c src/MD2.c -o build/temp.linux-x86_64-3.8/src/MD2.o
src/MD2.c:31:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wo7npi4x/pycrypto_1a5c9f1c1c3446a6a44b1061e80eedc8/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-zy55j0yw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pycrypto Check the logs for full command output.
#
I thinking it is probably down to this:
src/MD2.c:31:10: fatal error: Python.h: No such file or directory
Questions I have are:
Can I download the package and install from local tar?
Can I install to Python3 from the existing Python2 installation?
Can I tell Python3 how to 'use' packages currently installed under (and usable by) Python2?
Any thoughts/advice?
This is only a partial answer - to Question 1 above:
Can I download the package and install from local tar?
Install Python Module Manually:
# Verify the module is not already installed
python3 -m pip list
# As above - Python 2.x
python -m pip list
# Download the module
curl <MODULE_DOWNLOAD_URL> -o <MODULE_FILE_NAME>
# Make sure setuptools are up to date - Python 3.x
python3 -m pip install --upgrade setuptools
# As above - Python 2.x
python -m pip install --upgrade setuptools
# Extract the downloaded gzipped tar file if necessary
tar -xvf <MODULE_FILE_NAME>
# cd into the extracted module folder if created
cd <MODULE_FOLDER>
# Run the included setup.py script to install the module
python3 setup.py install
# Same for Python 2.x
python setup.py install
# Verify the module was successfully installed
python3 -m pip list
# As above - Python 2.x
python -m pip list
If all went well, the new module should now appear in the list of installed/available modules.
Try pip install pipwin and then pipwin install pycrypto but if this doesn't work it means you might have to downgrade your python version to 3.3 and 1.5.2 is not supported since.this is so because pycrypto was launched in 2013 when python 3.8 wasn't made so there is no support.

Getting error installing custom build tensorflow 1.12 wheel with python 3.6

I am trying to install a custom tensorflow 1.12 wheel on ppc64le
IBM Power9 system with NVIDIA Pascal V100 but getting the following error:
gcc -pthread -B /ccs/home/shubhankar/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DH5_USE_16_API -I./h5py -I/tmp/pip-install-d__8pdpg/h5py/lzf -I/opt/local/include -I/usr/local/include -I/ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/ccs/home/shubhankar/miniconda3/include/python3.6m -c /tmp/pip-install-d__8pdpg/h5py/h5py/defs.c -o build/temp.linux-ppc64le-3.6/tmp/pip-install-d__8pdpg/h5py/h5py/defs.o
In file included from /ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from /tmp/pip-install-d__8pdpg/h5py/h5py/api_compat.h:26,
from /tmp/pip-install-d__8pdpg/h5py/h5py/defs.c:657:
/ccs/home/shubhankar/miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^
In file included from /tmp/pip-install-d__8pdpg/h5py/h5py/defs.c:657:0:
/tmp/pip-install-d__8pdpg/h5py/h5py/api_compat.h:27:18: fatal error: hdf5.h: No such file or directory
#include "hdf5.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Rolling back uninstall of h5py
Command "/ccs/home/shubhankar/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-d__8pdpg/h5py/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-5_3ofwib/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-d__8pdpg/h5py/
It breaks at the installation of h5py for some reason. It all starts with a warning message. I am not sure if it is related to it.
Cythonizing /tmp/pip-install-d__8pdpg/h5py/h5py/h5z.pyx
/tmp/pip-install-d__8pdpg/h5py/.eggs/Cython-0.29.1-py3.6-linux-ppc64le.egg/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-d__8pdpg/h5py/h5py/h5z.pxd
And finally
Rolling back uninstall of h5py
Command "/ccs/home/shubhankar/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-d__8pdpg/h5py/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-5_3ofwib/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-d__8pdpg/h5py/
I am using miniconda3 for package management. The system installed gcc version is 4.8.5
You're installing tensorflow on a non-standard architecture (there are no precompiled wheels at PyPI) so pip has to compile everything (including dependencies, including h5py) from sources.
To compile h5py from sources you need to install HDF5 1.8.4 or newer with development headers. See http://docs.h5py.org/en/stable/build.html#source-installation for details.
Install libhdf5-dev using your OS' package manager if the package is available. Or install HDF5 from sources.

Pycharm failed to install package sawtooth-sdk

When I try to import the sawtooth SDK into Pycharm it failes with the following error
Collecting sawtooth-sdk==1.0.1
Using cached sawtooth-sdk-1.0.1.tar.gz
Requirement already satisfied: colorlog in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from sawtooth-sdk==1.0.1)
Collecting sawtooth-signing (from sawtooth-sdk==1.0.1)
Using cached sawtooth-signing-1.0.1.tar.gz
Collecting protobuf (from sawtooth-sdk==1.0.1)
Using cached protobuf-3.5.2.post1-cp36-cp36m-manylinux1_x86_64.whl
Collecting pyzmq (from sawtooth-sdk==1.0.1)
Using cached pyzmq-17.0.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting toml (from sawtooth-sdk==1.0.1)
Using cached toml-0.9.4.tar.gz
Collecting PyYAML (from sawtooth-sdk==1.0.1)
Using cached PyYAML-3.12.tar.gz
Collecting secp256k1 (from sawtooth-signing->sawtooth-sdk==1.0.1)
Using cached secp256k1-0.13.2.tar.gz
Collecting six>=1.9 (from protobuf->sawtooth-sdk==1.0.1)
Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from protobuf->sawtooth-sdk==1.0.1)
Requirement already satisfied: cffi>=1.3.0 in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from secp256k1->sawtooth-signing->sawtooth-sdk==1.0.1)
Requirement already satisfied: pycparser in /home/user/PycharmProjects/test/venv/lib/python3.6/site-packages (from cffi>=1.3.0->secp256k1->sawtooth-signing->sawtooth-sdk==1.0.1)
Installing collected packages: secp256k1, sawtooth-signing, six, protobuf, pyzmq, toml, PyYAML, sawtooth-sdk
Running setup.py install for secp256k1: started
Running setup.py install for secp256k1: finished with status 'error'
Complete output from command /home/user/PycharmProjects/test/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/secp256k1/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-g3n5renb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/PycharmProjects/test/venv/include/site/python3.6/secp256k1:
0.29.1
Installed libsecp256k1 is unusable falling back to bundled version.
Using bundled libsecp256k1
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/secp256k1
copying secp256k1/__init__.py -> build/lib.linux-x86_64-3.6/secp256k1
copying secp256k1/__main__.py -> build/lib.linux-x86_64-3.6/secp256k1
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
generating cffi module 'build/temp.linux-x86_64-3.6/_libsecp256k1.c'
creating build/temp.linux-x86_64-3.6
building '_libsecp256k1' extension
creating build/temp.linux-x86_64-3.6/build
creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/user/PycharmProjects/test/venv/include -I/usr/include/python3.6m -c build/temp.linux-x86_64-3.6/_libsecp256k1.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_libsecp256k1.o
build/temp.linux-x86_64-3.6/_libsecp256k1.c:22:24: fatal error: pyconfig.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/user/PycharmProjects/test/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/secp256k1/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-g3n5renb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/PycharmProjects/test/venv/include/site/python3.6/secp256k1" failed with error code 1 in /tmp/pycharm-packaging/secp256k1/
When I run the pip command pip install sawtooth-sdk==1.0.1 it succeeds but it installs the files to python 2.7 version and I need to install it for python 3.6 which it is the interpreter I have use for this project. Or is there anyway to import them directly into pycharm from the folder of the sdk the sawtooth project provides?? Any help??
Use pip3 which is available for Ubuntu-16.04
sudo apt-get install python3-pip
sudo pip3 install sawtooth-sdk==1.0.1
Another solution for cases where you cannot change Python version: install secp256k1 library in system. For example, to install it on python3.7 docker image:
RUN apt update && apt install -y libsecp256k1-dev libsecp256k1-0
I changed the python interpreter to version 3.5 and it installed correctly

How to connect to Message Hub from Data Science Experience / Spark as a Service using confluent-kafka-python?

The Bluemix MessageHub docs point python users to the confluent kafka library:
So I tried to install:
!pip install --user confluent-kafka
However, I've hit this error:
Collecting confluent-kafka
Using cached confluent-kafka-0.9.1.2.tar.gz
Installing collected packages: confluent-kafka
Running setup.py install for confluent-kafka ... - \ error
Complete output from command /usr/local/src/bluemix_jupyter_bundle.v22/notebook/bin/python -u -c "import setuptools, tokenize;__file__='/gpfs/global_fs01/sym_shared/YPProdSpark/user/xxxx/notebook/tmp/pip-build-N3zDUh/confluent-kafka/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /gpfs/fs01/user/xxxx/notebook/tmp/pip-PyAwq2-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/confluent_kafka
copying confluent_kafka/__init__.py -> build/lib.linux-x86_64-2.7/confluent_kafka
creating build/lib.linux-x86_64-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/__init__.py -> build/lib.linux-x86_64-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/verifiable_consumer.py -> build/lib.linux-x86_64-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/verifiable_producer.py -> build/lib.linux-x86_64-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/verifiable_client.py -> build/lib.linux-x86_64-2.7/confluent_kafka/kafkatest
running build_ext
building 'confluent_kafka.cimpl' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/confluent_kafka
creating build/temp.linux-x86_64-2.7/confluent_kafka/src
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/src/bluemix_jupyter_bundle.v22/notebook/include/python2.7 -c confluent_kafka/src/confluent_kafka.c -o build/temp.linux-x86_64-2.7/confluent_kafka/src/confluent_kafka.o
In file included from confluent_kafka/src/confluent_kafka.c:17:0:
confluent_kafka/src/confluent_kafka.h:20:32: fatal error: librdkafka/rdkafka.h: No such file or directory
#include <librdkafka/rdkafka.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/src/bluemix_jupyter_bundle.v22/notebook/bin/python -u -c "import setuptools, tokenize;__file__='/gpfs/global_fs01/sym_shared/YPProdSpark/user/xxxx/notebook/tmp/pip-build-N3zDUh/confluent-kafka/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /gpfs/fs01/user/xxxx/notebook/tmp/pip-PyAwq2-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /gpfs/global_fs01/sym_shared/YPProdSpark/user/xxxx/notebook/tmp/pip-build-N3zDUh/confluent-kafka/
As per the confluent readme, you need the librdkafka native library installed before you can use their Python client.
As you found in your other comment their is the alternative pure Python library kafka-python which you might find easier to work with for a Bluemix application

Resources