basketball_reference_web_scraper
basketball_reference_web_scraper copied to clipboard
Error "Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?"
When trying to install this on my Windows 10 machine, I conintually get this error. I've tried finding out how to install "libxml2" but it's proved to be near impossible. Does anyone know of a solution to this?
Collecting basketball-reference-web-scraper Using cached basketball_reference_web_scraper-4.12.1-py3-none-any.whl (24 kB) Requirement already satisfied: idna==2.7 in c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages (from basketball-reference-web-scraper) (2.7) Collecting lxml==4.5.1 Using cached lxml-4.5.1.tar.gz (4.5 MB) Preparing metadata (setup.py) ... done Requirement already satisfied: certifi==2018.10.15 in c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages (from basketball-reference-web-scraper) (2018.10.15) Requirement already satisfied: pytz==2018.6 in c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages (from basketball-reference-web-scraper) (2018.6) Requirement already satisfied: requests==2.20.0 in c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages (from basketball-reference-web-scraper) (2.20.0) Requirement already satisfied: chardet==3.0.4 in c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages (from basketball-reference-web-scraper) (3.0.4) Requirement already satisfied: urllib3==1.24.3 in c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages (from basketball-reference-web-scraper) (1.24.3) Using legacy 'setup.py install' for lxml, since package 'wheel' is not installed. Installing collected packages: lxml, basketball-reference-web-scraper Attempting uninstall: lxml Found existing installation: lxml 4.7.1 Uninstalling lxml-4.7.1: Successfully uninstalled lxml-4.7.1 Running setup.py install for lxml ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\kenna\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kenna\\AppData\\Local\\Temp \\pip-install-mnj0e58e\\lxml_d741f397c93f485abd07ba1e71c16bcb\\setup.py'"'"'; __file__='"'"'C:\\Users\\kenna\\AppData\\Local\\Temp\\pip-install-mnj0e58e\\lxml_d741f397c93f485abd07ba1e71c1 6bcb\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().rep lace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\kenna\AppData\Local\Temp\pip-record-tdpknynh\install-record.txt' --s ingle-version-externally-managed --compile --install-headers 'C:\Users\kenna\AppData\Local\Programs\Python\Python39\Include\lxml' cwd: C:\Users\kenna\AppData\Local\Temp\pip-install-mnj0e58e\lxml_d741f397c93f485abd07ba1e71c16bcb\ Complete output (94 lines): Building lxml version 4.5.1. Building without Cython. Building against pre-built libxml2 andl libxslt libraries running install running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\lxml copying src\lxml\builder.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\cssselect.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\sax.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.9\lxml copying src\lxml\__init__.py -> build\lib.win-amd64-3.9\lxml creating build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.9\lxml\includes creating build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\builder.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\clean.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\defs.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\diff.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.9\lxml\html copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.9\lxml\html creating build\lib.win-amd64-3.9\lxml\isoschematron copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.9\lxml\isoschematron copying src\lxml\etree.h -> build\lib.win-amd64-3.9\lxml copying src\lxml\etree_api.h -> build\lib.win-amd64-3.9\lxml copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.9\lxml copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.9\lxml copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.9\lxml\includes copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.9\lxml\includes creating build\lib.win-amd64-3.9\lxml\isoschematron\resources creating build\lib.win-amd64-3.9\lxml\isoschematron\resources\rng copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\rng creating build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl creating build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl\iso-schematron-xslt 1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.9\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 running build_ext building 'lxml.etree' extension creating build\temp.win-amd64-3.9 creating build\temp.win-amd64-3.9\Release creating build\temp.win-amd64-3.9\Release\src creating build\temp.win-amd64-3.9\Release\src\lxml C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc\lxml\includes -IC:\Users\kenna\AppData\Local\Programs\Python\Python39\include -IC:\Users\kenna\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visu al Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include /Tcsrc\lxml\etree.c /Fobuild\temp.win-amd64-3.9\Release\src\lxml\etree.obj -w cl : Command line warning D9025 : overriding '/W3' with '/w' etree.c C:\Users\kenna\AppData\Local\Programs\Python\Python39\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory Compile failed: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 creating Users creating Users\kenna creating Users\kenna\AppData creating Users\kenna\AppData\Local creating Users\kenna\AppData\Local\Temp C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include /TcC:\Users\kenna\AppData\Local\Temp\xmlXPathInitiw_z6tmw.c /FoUsers\kenna\AppData\Local\Temp\xmlXPath Initiw_z6tmw.obj xmlXPathInitiw_z6tmw.c C:\Users\kenna\AppData\Local\Temp\xmlXPathInitiw_z6tmw.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 ********************************************************************************* Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? ********************************************************************************* ---------------------------------------- Rolling back uninstall of lxml Moving to c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages\lxml-4.7.1.dist-info\ from C:\Users\kenna\AppData\Local\Programs\Python\Python39\Lib\site-packages\~xml-4.7.1.dist-info Moving to c:\users\kenna\appdata\local\programs\python\python39\lib\site-packages\lxml\ from C:\Users\kenna\AppData\Local\Programs\Python\Python39\Lib\site-packages\~xml ERROR: Command errored out with exit status 1: 'C:\Users\kenna\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\U sers\\kenna\\AppData\\Local\\Temp\\pip-install-mnj0e58e\\lxml_d741f397c93f485abd07ba1e71c16bcb\\setup.py'"'"'; __file__='"'"'C:\\Users\\kenna\\AppData\\Local\\Temp\\pip-install-mnj0e58e\\ lxml_d741f397c93f485abd07ba1e71c16bcb\\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 'C:\Users\kenna\AppData\Local\Temp\pip-record -tdpknynh\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\kenna\AppData\Local\Programs\Python\Python39\Include\lxml' Check the logs for full command output.
same issue here, looking for solution
I'm not sure if this is an issue with Windows 10(/11) or Python 3.9, or the combination of the two, but in any event switching to Python 3.8 fixed the issue for me.
I think this should be resolved as of release 4.13.1.
If you're still seeing this issue, please re-open this issue and I can take a look.
Apologies for the delayed response.