Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue installing with pip on ubuntu #14

Open
Brett-Plemons opened this issue Jun 1, 2019 · 2 comments
Open

Issue installing with pip on ubuntu #14

Brett-Plemons opened this issue Jun 1, 2019 · 2 comments

Comments

@Brett-Plemons
Copy link

I am trying to install a hiveql kernel for ipython and it requires sasl=0.2 when i try to install it or just sasl on its own i get the same building the wheel error

Processing ./Downloads/sasl-0.2.1.tar.gz
Requirement already satisfied: six in ./anaconda3/lib/python3.7/site-packages (from sasl==0.2.1) (1.12.0)
Building wheels for collected packages: sasl
  Building wheel for sasl (setup.py) ... error
  Complete output from command /home/brett/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-wnd93_qp/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-uq_iia0d --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/sasl
  copying sasl/__init__.py -> build/lib.linux-x86_64-3.7/sasl
  running egg_info
  writing sasl.egg-info/PKG-INFO
  writing dependency_links to sasl.egg-info/dependency_links.txt
  writing requirements to sasl.egg-info/requires.txt
  writing top-level names to sasl.egg-info/top_level.txt
  reading manifest file 'sasl.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'sasl.egg-info/SOURCES.txt'
  copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.7/sasl
  copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.7/sasl
  copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.7/sasl
  running build_ext
  building 'sasl.saslwrapper' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/sasl
  gcc -pthread -B /home/brett/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/home/brett/anaconda3/include/python3.7m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.7/sasl/saslwrapper.o
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  In file included from sasl/saslwrapper.cpp:254:0:
  sasl/saslwrapper.h:22:10: fatal error: sasl/sasl.h: No such file or directory
   #include <sasl/sasl.h>
            ^~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for sasl
  Running setup.py clean for sasl
Failed to build sasl
Installing collected packages: sasl
  Running setup.py install for sasl ... error
    Complete output from command /home/brett/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-wnd93_qp/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-7jrpscg5/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/sasl
    copying sasl/__init__.py -> build/lib.linux-x86_64-3.7/sasl
    running egg_info
    writing sasl.egg-info/PKG-INFO
    writing dependency_links to sasl.egg-info/dependency_links.txt
    writing requirements to sasl.egg-info/requires.txt
    writing top-level names to sasl.egg-info/top_level.txt
    reading manifest file 'sasl.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'sasl.egg-info/SOURCES.txt'
    copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.7/sasl
    copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.7/sasl
    copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.7/sasl
    running build_ext
    building 'sasl.saslwrapper' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/sasl
    gcc -pthread -B /home/brett/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/home/brett/anaconda3/include/python3.7m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.7/sasl/saslwrapper.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from sasl/saslwrapper.cpp:254:0:
    sasl/saslwrapper.h:22:10: 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 "/home/brett/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-wnd93_qp/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-7jrpscg5/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-wnd93_qp/

I am not really sure where to go here. I tried cloning the repository and building it manually it gives the same error, I tried downloading the tar.gz from pipy, same error. I also tried using pure-sasl but that apparently isnt compatible with the kernel.

@silpodx
Copy link

silpodx commented Dec 13, 2019

Brett, you have the issue mentioned in https://github.com/cloudera/python-sasl/issues/10
Just install with apt the library mentioned (apt install libsasl2-dev) and that will provide the header you need.

@ahonnecke
Copy link

Here's a dockerfile that will fix the issue:

FROM python:3.7 as base

ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PYTHONUNBUFFERED 1

RUN apt-get update && \
        apt-get install -yq python3-dev \
        libsasl2-dev \
        && apt-get clean

WORKDIR /app

COPY ./bin /app/bin/

RUN chmod u+x bin/*
RUN pip install --upgrade pip && pip install pipenv

COPY Pipfile .
COPY Pipfile.lock .

RUN pipenv install --dev

COPY . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants