我正在尝试安装scrapy。收到错误后:
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c src/twisted/test/raiser.c -o build/temp.linux-x86_64-3.6/src/twisted/test/raiser.o
src/twisted/test/raiser.c:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-8nvpkc0u/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-record-0rgdesq0/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-8nvpkc0u/Twisted/
我已经按照某些链接中的说明进行了安装:
sudo pip install -U setuptools
sudo pip install -U wheel
即使那样,我仍然遇到相同的错误。为了使这项工作有效,我尝试安装Twisted,因为它是造成障碍的软件包。所以
命令sudo pip3 install twisted
失败,并带有上述相同的错误代码。