linux下安装Scrapy所遇到的compilation terminated问题

  • Post author:
  • Post category:linux



执行



sudo pip3 install scrapy




来安装Scrapy时,终端报出如下问题:





 #include "Python.h"
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5x8qvmrv/Twisted/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-5il_zhwm-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-5x8qvmrv/Twisted/


找不到Python.h,这是因为没有安装python-dev


但此时

应该安装python3-dev, 而不是python-dev

sudo apt install python3-dev



版权声明:本文为FK103原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。