由于gcc错误,无法使用pip安装sasl

时间:2019-06-07 07:28:37

标签: python python-3.x ubuntu gcc sasl

我想安装一个特定的库,该库在需求中包括几个模块。其中两个是saslsasl-thrift。我在安装它们时遇到错误,它们的setup.py失败了。

我尝试解决该错误,并意识到gcc未安装在Docker容器中,所以我安装了它。即使在那之后,我也收到相同的错误,无法理解。我也读过类似的问题,在其中发现了PyPy的用法,但是我无法联系或推论出它们的任何进一步步骤。

我安装库的命令是:

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

需求文件是:

# 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

安装库时的错误是:

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.

我希望该库能够顺利安装。

1 个答案:

答案 0 :(得分:0)

我通过安装<button id="set">Show and fade out</button> <button id="reset">Reset</button> <div id="a" class="example">Example A</div> <div id="b" class="example">Example B</div>找到了解决方案。该库具有标头,我自己不必照顾sudo apt-get install libsasl2-devgcc