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

执行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


猜你喜欢

转载自blog.csdn.net/FK103/article/details/80047523