安装pydeep时,使用命令'gcc'失败,退出状态为1。

3
我正在尝试在CentOS 64b上通过pip install pydeep安装pydeep,但是出现了以下错误:error: command 'gcc' failed with exit status 1。我尝试了安装gcc和许多其他软件包,如python-dev等,但仍然没有结果。我还从GitHub上克隆了它并尝试了:python setup.py build,但是我遇到了同样的问题(请注意,我已经有了libssdeep)。
Downloading/unpacking pydeep
  Running setup.py egg_info for package pydeep
Installing collected packages: pydeep
  Running setup.py install for pydeep
    building 'pydeep' extension
    gcc -pthread -fno-strict-aliasing -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 -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/python2.6 -c pydeep.c -o build/temp.linux-x86_64-2.6/pydeep.o
    pydeep.c:2:19: error: fuzzy.h: No such file or directory
    pydeep.c: In function ‘pydeep_hash_file’:
    pydeep.c:33: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)
    pydeep.c:33: error: (Each undeclared identifier is reported only once
    pydeep.c:33: error: for each function it appears in.)
    pydeep.c:38: warning: implicit declaration of function ‘fuzzy_hash_file’
    pydeep.c: In function ‘pydeep_hash_buf’:
    pydeep.c:64: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)
    pydeep.c:72: warning: implicit declaration of function ‘fuzzy_hash_buf’
    pydeep.c: In function ‘pydeep_compare’:
    pydeep.c:90: warning: implicit declaration of function ‘fuzzy_compare’
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-bogdan/pydeep/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EQweL1-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_ext

building 'pydeep' extension

gcc -pthread -fno-strict-aliasing -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 -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/python2.6 -c pydeep.c -o build/temp.linux-x86_64-2.6/pydeep.o

pydeep.c:2:19: error: fuzzy.h: No such file or directory

pydeep.c: In function ‘pydeep_hash_file’:

pydeep.c:33: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)

pydeep.c:33: error: (Each undeclared identifier is reported only once

pydeep.c:33: error: for each function it appears in.)

pydeep.c:38: warning: implicit declaration of function ‘fuzzy_hash_file’

pydeep.c: In function ‘pydeep_hash_buf’:

pydeep.c:64: error: ‘FUZZY_MAX_RESULT’ undeclared (first use in this function)

pydeep.c:72: warning: implicit declaration of function ‘fuzzy_hash_buf’

pydeep.c: In function ‘pydeep_compare’:

pydeep.c:90: warning: implicit declaration of function ‘fuzzy_compare’

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-bogdan/pydeep/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EQweL1-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-bogdan/pydeep
Storing complete log in /root/.pip/pip.log

如果您需要完整的日志或某些特定信息,我会尽快提供。谢谢!

你是否安装了 libssdeep-dev 或类似的软件? - ams
是的,我也安装了它。 - Bobina
然后你需要找出fuzzy.h在哪里,gcc正在寻找它的位置,以及为什么它们不一样。 - ams
1
谢谢你的提示。经过一番努力,我终于让它正常工作了。确实,fuzzy 是问题所在。问题已解决! - Bobina
1个回答

10

如果其他人也遇到在Ubuntu中编译pydeep时出现问题,可以尝试运行以下命令进行修复:

sudo apt-get install python-dev libfuzzy-dev

需要以root身份运行pydeep的setup.py文件


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接