elapouya / python-docx-template

Use a docx as a jinja2 template
GNU Lesser General Public License v2.1
2.01k stars 392 forks source link

pip install docxtpl error #511

Open jason-gao opened 1 year ago

jason-gao commented 1 year ago

when i excute pip install docxtpl then error occured
Python 2.7.16 Python 3.9.4

I try these version , always occur this error: help

creating build/lib.macosx-10.15-x86_64-cpython-39/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.15-x86_64-cpython-39/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.15-x86_64-cpython-39/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.15-x86_64-cpython-39/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.15-x86_64-cpython-39/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.15-x86_64-cpython-39/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.15-x86_64-cpython-39/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 running build_ext building 'lxml.etree' extension creating build/temp.macosx-10.15-x86_64-cpython-39 creating build/temp.macosx-10.15-x86_64-cpython-39/src creating build/temp.macosx-10.15-x86_64-cpython-39/src/lxml clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/lxml/etree.c -o build/temp.macosx-10.15-x86_64-cpython-39/src/lxml/etree.o -w -flat_namespace In file included from src/lxml/etree.c:864: src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found

include "libxml/xmlversion.h"

           ^~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  Compile failed: command '/usr/bin/clang' failed with exit code 1
  creating var
  creating var/folders
  creating var/folders/6g
  creating var/folders/6g/vjt1b74d5yl0xbfnjjqm0f180000gn
  creating var/folders/6g/vjt1b74d5yl0xbfnjjqm0f180000gn/T
  cc -I/usr/include/libxml2 -c /var/folders/6g/vjt1b74d5yl0xbfnjjqm0f180000gn/T/xmlXPathInitt_vv0ian.c -o var/folders/6g/vjt1b74d5yl0xbfnjjqm0f180000gn/T/xmlXPathInitt_vv0ian.o
  /var/folders/6g/vjt1b74d5yl0xbfnjjqm0f180000gn/T/xmlXPathInitt_vv0ian.c:1:10: fatal error: 'libxml/xpath.h' file not found
  #include "libxml/xpath.h"
           ^~~~~~~~~~~~~~~~
  1 error generated.
  *********************************************************************************
  Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
  Perhaps try: xcode-select --install
  *********************************************************************************
  error: command '/usr/bin/clang' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for lxml Running setup.py clean for lxml Failed to build lxml ERROR: Could not build wheels for lxml, which is required to install pyproject.toml-based projects

jason-gao commented 1 year ago

export CPATH="/usr/local/Cellar/libxml2/2.9.10_2/include/libxml2:$CPATH" add this can work ,thank you