安装pythonsnappy时出现问题

2024-04-23 16:43:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在Amazon Linux EC2实例中安装python snappy,但始终收到以下错误,您知道如何解决此问题吗:

sudo python3.6 -m pip install python-snappy
Collecting python-snappy
  Using cached https://files.pythonhosted.org/packages/89/fe/a81a219c183c7e578b6f82d9c2425df045548877be6559358e8560c1e9fd/python-snappy-0.5.3.tar.gz
Installing collected packages: python-snappy
  Running setup.py install for python-snappy ... error
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e07ios_o/python-snappy/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-k7rd94ik/install-record.txt --single-version-externally-managed --compile:
    /usr/lib64/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'cffi_modules'
      warnings.warn(msg)
    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/snappy
    copying snappy/snappy_cffi.py -> build/lib.linux-x86_64-3.6/snappy
    copying snappy/snappy_formats.py -> build/lib.linux-x86_64-3.6/snappy
    copying snappy/snappy.py -> build/lib.linux-x86_64-3.6/snappy
    copying snappy/__init__.py -> build/lib.linux-x86_64-3.6/snappy
    copying snappy/snappy_cffi_builder.py -> build/lib.linux-x86_64-3.6/snappy
    copying snappy/__main__.py -> build/lib.linux-x86_64-3.6/snappy
    copying snappy/hadoop_snappy.py -> build/lib.linux-x86_64-3.6/snappy
    running build_ext
    building 'snappy._snappy' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/snappy
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c snappy/snappymodule.cc -o build/temp.linux-x86_64-3.6/snappy/snappymodule.o
    gcc: error trying to exec 'cc1plus': execvp: No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e07ios_o/python-snappy/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-k7rd94ik/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-e07ios_o/python-snappy/

Tags: installpippybuildcreatinglinuxlibcode