安装scrapy报错 Python.h: 没有那个文件或目录
2015-12-31 10:30
676 查看
安装scrapy的时候报错,其实这个错误是一个间接,由其依赖引起。
build/temp.linux-x86_64-2.7/twisted/test/raiser.o
twisted/test/raiser.c:4:20: fatal error: Python.h: 没有那个文件或目录
#include “Python.h”
^
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
解决的办法:
安装python-dev,这是Python的头文件和静态库包:
sudo apt-get install python-dev
注意:
一定要重新安装一下报错的module,这里是指twisted.
* 如果直接安装pip install scrapy 会提示已经安装完成,但实际上依赖并没有安装完成。
* 如果不安装好twisted后面爬取示例网站的时候是会报错的。
build/temp.linux-x86_64-2.7/twisted/test/raiser.o
twisted/test/raiser.c:4:20: fatal error: Python.h: 没有那个文件或目录
#include “Python.h”
^
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
解决的办法:
安装python-dev,这是Python的头文件和静态库包:
sudo apt-get install python-dev
注意:
一定要重新安装一下报错的module,这里是指twisted.
pip install twisted
* 如果直接安装pip install scrapy 会提示已经安装完成,但实际上依赖并没有安装完成。
* 如果不安装好twisted后面爬取示例网站的时候是会报错的。
相关文章推荐
- 安装scrapy报错 Python.h: 没有那个文件或目录
- python笔记
- day①:python的用户交互
- Python 删除 数组
- 报错 no module named win32api 的解决方案 以及python添加注册表方法
- python学习笔记(一)---python简介
- 我们一起学python-helloworld
- Python标准库11 多进程探索 (multiprocessing包)
- win8.1+python34安装Numpy
- MySQL Connector/Python 安装、测试
- python安装setuptools
- python 安装 setuptools Compression requires the (missing) zlib module 的解决方案
- It's possible that the above module doesn't match the current version of Python
- Python基础第三篇
- 用python爬取文章链接并分类
- python实现爬虫统计学校BBS男女比例(一)
- python实现爬虫统计学校BBS男女比例之多线程爬虫(二)
- python实现爬虫统计学校BBS男女比例之数据处理(三)
- 基于python的Tkinter实现一个简易计算器
- python实现颜色空间转换程序(Tkinter)