Missing Python.h

Dennis Putnam dap1@bellsouth.net
Tue Sep 21 18:37:50 GMT 2021


I am trying to install 'requests_html' and when it tries to do a compile 
it fails because Python.h is missing. I have python2-devl installed. I 
notice that it is looking for it in /pub which apparently does not 
exist. Can someone help? TIA.

Here is the entire 'pip' output:

$ pip install requests_html
Collecting requests_html
   Using cached requests_html-0.10.0-py3-none-any.whl (13 kB)
Collecting requests
   Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting w3lib
   Using cached w3lib-1.22.0-py2.py3-none-any.whl (20 kB)
Collecting parse
   Using cached parse-1.19.0.tar.gz (30 kB)
Collecting fake-useragent
   Using cached fake-useragent-0.1.11.tar.gz (13 kB)
Collecting pyquery
   Using cached pyquery-1.4.3-py3-none-any.whl (22 kB)
Collecting bs4
   Using cached bs4-0.0.1.tar.gz (1.1 kB)
Collecting pyppeteer>=0.0.14
   Using cached pyppeteer-0.2.6-py3-none-any.whl (83 kB)
Requirement already satisfied: tqdm<5.0.0,>=4.42.1 in 
/usr/local/lib/python3.8/site-packages (from 
pyppeteer>=0.0.14->requests_html) (4.62.3)
Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in 
/usr/local/lib/python3.8/site-packages (from 
pyppeteer>=0.0.14->requests_html) (1.26.6)
Collecting appdirs<2.0.0,>=1.4.3
   Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting importlib-metadata>=1.4
   Using cached importlib_metadata-4.8.1-py3-none-any.whl (17 kB)
Requirement already satisfied: pyee<9.0.0,>=8.1.0 in 
/usr/local/lib/python3.8/site-packages (from 
pyppeteer>=0.0.14->requests_html) (8.2.2)
Requirement already satisfied: websockets<10.0,>=9.1 in 
/usr/local/lib/python3.8/site-packages (from 
pyppeteer>=0.0.14->requests_html) (9.1)
Requirement already satisfied: zipp>=0.5 in 
/usr/local/lib/python3.8/site-packages (from 
importlib-metadata>=1.4->pyppeteer>=0.0.14->requests_html) ( 3.5.0)
Requirement already satisfied: beautifulsoup4 in 
/usr/local/lib/python3.8/site-packages (from bs4->requests_html) (4.10.0)
Requirement already satisfied: soupsieve>1.2 in 
/usr/local/lib/python3.8/site-packages (from 
beautifulsoup4->bs4->requests_html) (2.2.1)
Collecting cssselect>0.7.9
   Using cached cssselect-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting lxml>=2.1
   Using cached lxml-4.6.3.tar.gz (3.2 MB)
Collecting idna<4,>=2.5
   Using cached idna-3.2-py3-none-any.whl (59 kB)
Collecting certifi>=2017.4.17
   Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting charset-normalizer~=2.0.0
   Using cached charset_normalizer-2.0.6-py3-none-any.whl (37 kB)
Requirement already satisfied: six>=1.4.1 in 
/usr/local/lib/python3.8/site-packages (from w3lib->requests_html) (1.16.0)
Using legacy 'setup.py install' for bs4, since package 'wheel' is not 
installed.
Using legacy 'setup.py install' for fake-useragent, since package 
'wheel' is not installed.
Using legacy 'setup.py install' for parse, since package 'wheel' is not 
installed.
Using legacy 'setup.py install' for lxml, since package 'wheel' is not 
installed.
Installing collected packages: lxml, importlib-metadata, idna, 
cssselect, charset-normalizer, certifi, appdirs, w3lib, requests, 
pyquery, pyppeteer,
parse, fake-useragent, bs4, requests-html
     Running setup.py install for lxml ... error
     ERROR: Command errored out with exit status 1:
      command: /usr/bin/python -u -c 'import io, os, sys, setuptools, 
tokenize; sys.argv[0] = 
'"'"'/tmp/pip-install-mp64a75l/lxml_61e1128ed27f4063936a 
7a21e44c273e/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-mp64a75l/lxml_61e1128ed27f4063936a7a21e44c273e/setup.py'"'"';f 
= getattr(tokenize, '"'"'open'"'"', open)(__file__) if 
os.path.exists(__file__) else io.StringIO('"'"'from setuptools import 
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
install --record /tmp/pip-record-qafwouur/install-record.txt 
--single-version-externally-managed --compile --install-headers 
/usr/local/include/python3.8/lxml
          cwd: 
/tmp/pip-install-mp64a75l/lxml_61e1128ed27f4063936a7a21e44c273e/
     Complete output (86 lines):
     Building lxml version 4.6.3.
     Building without Cython.
     Building against libxml2 2.9.10 and libxslt 1.1.29
     running install
     running build
     running build_py
     creating build
     creating build/lib.cygwin-3.2.0-x86_64-3.8
     creating build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/builder.py -> build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/cssselect.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/doctestcompare.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/ElementInclude.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/pyclasslookup.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/sax.py -> build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/usedoctest.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/_elementpath.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/__init__.py -> build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     creating build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/__init__.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     creating build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/builder.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/clean.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/defs.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/diff.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/ElementSoup.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/formfill.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/html5parser.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/soupparser.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/usedoctest.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/_diffcommand.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/_html5builder.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/_setmixin.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     copying src/lxml/html/__init__.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/html
     creating build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron
     copying src/lxml/isoschematron/__init__.py -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron
     copying src/lxml/etree.h -> build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/etree_api.h -> build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/lxml.etree.h -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/lxml.etree_api.h -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml
     copying src/lxml/includes/c14n.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/config.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/dtdvalid.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/etreepublic.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/htmlparser.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/relaxng.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/schematron.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/tree.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/uri.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/xinclude.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/xmlerror.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/xmlparser.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/xmlschema.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/xpath.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/xslt.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/__init__.pxd -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/etree_defs.h -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     copying src/lxml/includes/lxml-version.h -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/includes
     creating 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources
     creating 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources/rng
     copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources/rng
     creating 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources/xsl
     copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources/xsl
     copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources/xsl
     creating 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 

     copying 
src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl 
-> build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron 
/resources/xsl/iso-schematron-xslt1
     copying 
src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl 
-> build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/re 
sources/xsl/iso-schematron-xslt1
     copying 
src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl 
-> build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschemat 
ron/resources/xsl/iso-schematron-xslt1
     copying 
src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl 
-> build/lib.cygwin-3.2.0-x86_64-3.8/lxml 
/isoschematron/resources/xsl/iso-schematron-xslt1
     copying 
src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl 
-> build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/ 
resources/xsl/iso-schematron-xslt1
     copying 
src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> 
build/lib.cygwin-3.2.0-x86_64-3.8/lxml/isoschematron/resources/xs 
l/iso-schematron-xslt1
     running build_ext
     building 'lxml.etree' extension
     creating build/temp.cygwin-3.2.0-x86_64-3.8
     creating build/temp.cygwin-3.2.0-x86_64-3.8/src
     creating build/temp.cygwin-3.2.0-x86_64-3.8/src/lxml
     gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1 
-fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.10-1.x86_64/build=/usr/src/debug/python38-3.8.10-1 
-fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.10-1.x86_64/src/Python-3.8.10=/usr/src/debug/python38-3.8.10-1 
-ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-fstack-protector-strong --param=ssp-buffer-size=4 -DOPENSSL_NO_SSL3=1 
-fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.10-1.x86_64/build=/usr/src/debug/python38-3.8.10-1 
-fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.10-1.x86_64/src/Python-3.8.10=/usr/src/debug/python38-3.8.10-1 
-DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/include/libxml2 -Isrc 
-Isrc/lxml/includes -I/usr/include/python3.8 -c src/lxml/etree.c -o 
build/temp.cygwin-3.2.0-x86_64-3.8/src/lxml/etree.o -w
     src/lxml/etree.c:97:10: fatal error: Python.h: No such file or 
directory
        97 | #include "Python.h"
           |          ^~~~~~~~~~
     compilation terminated.
     Compile failed: command 'gcc' failed with exit status 1
     creating tmp
     cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c 
/tmp/xmlXPathInit4efcky6t.c -o tmp/xmlXPathInit4efcky6t.o
     cc tmp/xmlXPathInit4efcky6t.o -lxml2 -o a.out.exe
     error: command 'gcc' failed with exit status 1
     ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 
'import io, os, sys, setuptools, tokenize; sys.argv[0] = 
'"'"'/tmp/pip-install-mp64a75l/lxml_61e1128ed27f4063936a7a21e44c273e/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-mp64a75l/lxml_61e1128ed27f4063936a7a21e44c273e/setup.py'"'"';f 
= getattr(tokenize, '"'"'open'"'"', open)(__file__) if 
os.path.exists(__file__) else io.StringIO('"'"'from setuptools import 
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
install --record /tmp/pip-record-qafwouur/install-record.txt 
--single-version-externally-managed --compile --install-headers 
/usr/local/include/python3.8/lxml Check the logs for full command output.



More information about the Cygwin mailing list