PreTeXt upgrade on Windows failing -- lxml error

13 views
Skip to first unread message

Sean Fitzpatrick

unread,
Nov 4, 2025, 3:53:33 PM (2 days ago) Nov 4
to PreTeXt support
I'm trying to upgrade the version of PreTeXt installed on my Windows computer.

(Windows 11, with Python 3.14 installed via Python.org.)
Using 'pip install pretext --upgrade' I get the error "Building wheel for lxml (pyproject.toml) did not run successfully."

It seems it is trying to compile using Visual Studio, and failing. Here is the longer error output from pip:

Building wheels for collected packages: lxml
  Building wheel for lxml (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for lxml (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [127 lines of output]
      <string>:67: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
      C:\Users\Sean Fitzpatrick\AppData\Local\Temp\pip-build-env-56f8de_8\overlay\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: BSD License

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      Building lxml version 5.4.0.
      Building without Cython.
      Building against pre-built libxml2 andl libxslt libraries
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\builder.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\cssselect.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\doctestcompare.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\ElementInclude.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\sax.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\usedoctest.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\_elementpath.py -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\__init__.py -> build\lib.win-amd64-cpython-314\lxml
      creating build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\__init__.py -> build\lib.win-amd64-cpython-314\lxml\includes
      creating build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\builder.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\clean.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\defs.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\diff.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\formfill.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\html5parser.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\soupparser.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-cpython-314\lxml\html
      copying src\lxml\html\__init__.py -> build\lib.win-amd64-cpython-314\lxml\html
      creating build\lib.win-amd64-cpython-314\lxml\isoschematron
      copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-cpython-314\lxml\isoschematron
      copying src\lxml\etree.h -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\etree_api.h -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\lxml.etree.h -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\etree.pyx -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\objectify.pyx -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\apihelpers.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\classlookup.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\cleanup.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\debug.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\docloader.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\dtd.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\extensions.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\iterparse.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\nsclasses.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\objectpath.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\parser.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\parsertarget.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\proxy.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\public-api.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\readonlytree.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\relaxng.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\saxparser.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\schematron.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\serializer.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\xinclude.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\xmlerror.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\xmlid.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\xmlschema.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\xpath.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\xslt.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\xsltext.pxi -> build\lib.win-amd64-cpython-314\lxml
      copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\config.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-cpython-314\lxml\includes
      copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-cpython-314\lxml\includes
      creating build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\rng
      copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\rng
      creating build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl
      copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl
      copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl
      creating build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
      copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
      copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
      copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-cpython-314\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-cpython-314\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
      copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
      copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-cpython-314\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
      running build_ext
      building 'lxml.etree' extension
      creating build\temp.win-amd64-cpython-314\Release\src\lxml
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc\lxml\includes -IC:\Python314\include -IC:\Python314\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc\lxml\etree.c /Fobuild\temp.win-amd64-cpython-314\Release\src\lxml\etree.obj -w
      cl : Command line warning D9025 : overriding '/W3' with '/w'
      etree.c
      C:\Users\Sean Fitzpatrick\AppData\Local\Temp\pip-install-xcelqdsy\lxml_d8ebf1b577d44f26b55ebe0c967fe77a\src\lxml\includes/etree_defs.h(12): fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
      Compile failed: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      creating Users\SEANFI~1\AppData\Local\Temp
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /TcC:\Users\SEANFI~1\AppData\Local\Temp\xmlXPathInito3l4bzcf.c /FoUsers\SEANFI~1\AppData\Local\Temp\xmlXPathInito3l4bzcf.obj
      xmlXPathInito3l4bzcf.c
      C:\Users\SEANFI~1\AppData\Local\Temp\xmlXPathInito3l4bzcf.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
      *********************************************************************************
      Could not find function xmlXPathInit in library libxml2. Is libxml2 installed?
      Is your C compiler installed and configured correctly?
      *********************************************************************************
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lxml
Failed to build lxml

[notice] A new release of pip is available: 25.2 -> 25.3
[notice] To update, run: python.exe -m pip install --upgrade pip
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> lxml


Oscar Levin

unread,
Nov 4, 2025, 4:19:07 PM (2 days ago) Nov 4
to PreTeXt support
Very strange.  I'll preface by saying that I haven't not tried to install pretext with python 3.14, so I don't know if it is even likely to work.  But it will be important for us to figure that out at some point.

Something on your computer has specified the build tools for your Visual Studio (which is different from VS Code) as the first things on your path for compiling python wheels from source.  It might be worth inspecting your PATH variables to see if you can remove that.  Or uninstall Visual Studio if you don't need it for other things.

Or maybe you can skip this entirely by first running `pip install lxml --prefer-binary` which will try to install lxml without building it's wheel.

Sean Fitzpatrick

unread,
Nov 4, 2025, 6:42:33 PM (2 days ago) Nov 4
to pretext...@googlegroups.com
Thanks. Python 3.14 is the current version for Windows and it updates automatically, I think. 
I'm not using any sort of Conda to manage it.

I don't recall what on my machine needed visual studio. I don't think there's anything development related that isn't for PreTeXt!

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/a2181eb5-9ce8-4a3e-8c76-c716787505e4n%40googlegroups.com.

Sean Fitzpatrick

unread,
Nov 5, 2025, 3:16:17 PM (yesterday) Nov 5
to pretext...@googlegroups.com
Installing lxml first didn't help. I don't see any references to visual studio on my PATH. (I think maybe Sage is what required it? I don't remember...)
I will try uninstalling it next.
Reply all
Reply to author
Forward
0 new messages