Unable to install sasl using pip due to gcc errors
Asked Answered
A

1

7

I want to install a particular library which includes several modules in the requirements. Two of them are sasl and sasl-thrift. I am facing errors as while installing them, their setup.py fails.

I tried going through the error and realised that gcc is not installed in the docker container so I installed it. Even after that, I am getting the same error and unable to comprehend it. I also read similar questions in which I found the usage of PyPy but I could not relate or deduce any further steps from them.

My command to install the library is:

python3 -m pip install git+https://github.com/my_org/my_lib.git@jupyter-notebooks-v1#egg=athena

The requirements file is:

# If your are using it with airflow.
apache-airflow[celery,postgres,hive,password,crypto]==1.10.3
#  This file contain all the requirements to run dag and athena
tzlocal==1.5.1
urllib3==1.21.1
oauthlib==3.0.0
requests==2.18.4
coloredlogs==5.2
pymongo==3.6.1
fs==0.5.4
minio==4.0.6
sasl==0.2.1
thrift-sasl==0.3.0
boto3==1.9.115
botocore==1.12.115
mongoengine==0.17.0
haikunator==2.1.0
pycryptodome==3.7.3
pandas==0.24.2
pyarrow==0.12.1
CMRESHandler==1.0.0
elasticsearch==7.0.0

The error while installing the library is:

Found existing installation: oauthlib 3.0.1
    Uninstalling oauthlib-3.0.1:
      Successfully uninstalled oauthlib-3.0.1
  Running setup.py install for fs ... done
  Running setup.py install for sasl ... error
    Complete output from command /opt/conda/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ffcj3sct/sasl/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-x2a76dk1-record/install-record.txt --single-version-externally-managed --compile:
    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/sasl
    copying sasl/__init__.py -> build/lib.linux-x86_64-3.6/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.6/sasl
    copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.6/sasl
    copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.6/sasl
    running build_ext
    building 'sasl.saslwrapper' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/sasl
    gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/opt/conda/include/python3.6m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.6/sasl/saslwrapper.o
    gcc: error trying to exec 'cc1plus': execvp: No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/opt/conda/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ffcj3sct/sasl/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-x2a76dk1-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ffcj3sct/sasl/
You are using pip version 9.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I expect the library to get installed smoothly.

Adulterine answered 7/6, 2019 at 7:28 Comment(0)
A
16

I found the solution by installing sudo apt-get install libsasl2-dev. This library has the header and I don't have to take care of gcc and g++ myself.

Adulterine answered 7/6, 2019 at 7:54 Comment(4)
This doesn't solve the issue on Python 3.9Blackamoor
There was no Python 3.9 at the tome of this question. I would suggest asking this same question and in the MVC description, where you mention what you have already tried, mention this page.Adulterine
Its actually compatible with sasl==0.3.1Blackamoor
@Blackamoor how did you manage to solve it? it's not working for me with Python 3.8Beuthen

© 2022 - 2024 — McMap. All rights reserved.