0

I am trying to install scrapy. Upon receiving the error:

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/

I have followed instructions from certain links and installed:

sudo pip install -U setuptools
sudo pip install -U wheel

Even then, I am getting the same error. In order to make this work, I tried to install Twisted since it is the package causing the hindrance. So the command sudo pip3 install twisted failed with the same aforementioned error code.

hasherBaba
  • 319
  • 5
  • 18
  • 1
    You need to install the ``-dev`` package for your system Python package. – Graham Dumpleton Jul 06 '18 at 05:40
  • Give me the command please. – hasherBaba Jul 06 '18 at 05:46
  • I can't because I know nothing about what operating system you are using. You will need to search up operating system specific instructions on how to install system dev package for python. – Graham Dumpleton Jul 06 '18 at 06:50
  • I am using Ubuntu I have already run the those commands – hasherBaba Jul 06 '18 at 07:02
  • You have not installed the package for Python though. https://stackoverflow.com/questions/6230444/how-to-install-python-developer-package You need to work out the correct package name for the dev package based on the Python runtime package you have installed. Also read https://stackoverflow.com/questions/31002091/what-is-python-dev-package-used-for as to what the package is for. – Graham Dumpleton Jul 06 '18 at 07:20
  • A bit late but this saved my life. I was installing channels on my 3.6.7 python but the installed keep throwing me an error. I just 'sudo apt-get install python3-dev' and everything worked like a charm. – DavidMM Jun 02 '19 at 21:13

0 Answers0