首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用pypi安装刮伤时出错

使用pypi安装刮伤时出错
EN

Stack Overflow用户
提问于 2013-08-17 09:43:26
回答 1查看 990关注 0票数 1

我在Debian 6上使用python 2.7,我尝试使用以下命令安装scrapy (根据医生):

代码语言:javascript
复制
pip install Scrapy

得到了这个错误

代码语言:javascript
复制
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库时,所以我尝试使用以下方法单独安装它:

代码语言:javascript
复制
pip install Twisted

也犯了同样的错误。

我怎么才能解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-17 09:48:11

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

尝试安装python2.7-dev软件包。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18287358

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档