gpt4 book ai didi

python - 使用pypi安装scrapy时出错

转载 作者:太空宇宙 更新时间:2023-11-04 08:13:32 26 4
gpt4 key购买 nike

我在 Debian 6python 2.7 上,我尝试安装 scrapy(根据 the doc )使用命令:

pip install Scrapy

得到这个错误

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c twisted/runner/portmap.c -o build/temp.linux-x86_64-2.7/twisted/runner/portmap.o

twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory

twisted/runner/portmap.c:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

twisted/runner/portmap.c:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

twisted/runner/portmap.c:45: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PortmapMethods'

twisted/runner/portmap.c: In function 'initportmap':

twisted/runner/portmap.c:55: warning: implicit declaration of function 'Py_InitModule'

twisted/runner/portmap.c:55: error: 'PortmapMethods' undeclared (first use in this function)

twisted/runner/portmap.c:55: error: (Each undeclared identifier is reported only once

twisted/runner/portmap.c:55: error: for each function it appears in.)

error: command 'gcc' failed with exit status 1

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

我认为问题出在安装 Twisted 库时,所以我尝试使用以下方法单独安装它:

pip install Twisted

得到了同样的错误。

我该如何解决这个问题?

最佳答案

twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory

尝试安装 python2.7-dev 包。

关于python - 使用pypi安装scrapy时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18287358/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com