pip install lxml complains on clang

  • Last Update :
  • Techknowledgy :
pkg install libxml2 - dev libxslt - dev libiconv - dev
pkg install libxml2 libxslt
ERROR: Command errored out with exit status 1:
command: 'C:\Users\*******\PycharmProjects\handson\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\*******\\AppData\\Local\\Temp\\pip-install-ztksvhrz\\m3-libxml2-python_f044543e4ca140678bad250cf8feca47\\setup.py'"'"'; __file__='"'"'C:\\Users\\6110412\\AppData\\Local\\Temp\\pip-install-ztksvhrz\\m3-libxml2-python_f044543e4ca140678bad250cf8feca47\\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'"'"'))' egg_info --egg-base 'C:\Users\6110412\AppData\Local\Temp\pip-pip-egg-info-evb7zv8_'
cwd: C:\Users\empid\AppData\Local\Temp\pip-install-ztksvhrz\m3-libxml2-python_f044543e4ca140678bad250cf8feca47\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
      File "C:\Users\*******\AppData\Local\Temp\pip-install-ztksvhrz\m3-libxml2-python_f044543e4ca140678bad250cf8feca47\setup.py", line 70
      break;
      ^
      TabError: inconsistent use of tabs and spaces in indentation
      ----------------------------------------
ERROR: Command errored out with exit status 1:
   command: 'C:\Users\*******\PycharmProjects\handson\venv\Scripts\python.exe' - c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '
"'"
'C:\\Users\\*******\\AppData\\Local\\Temp\\pip-install-al39ikfz\\libxml2-python3_49a92dc4f1674927adaf10b6048d80a8\\setup.py'
"'"
'; __file__='
"'"
'C:\\Users\\6110412\\AppData\\Local\\Temp\\pip-install-al39ikfz\\libxml2-python3_49a92dc4f1674927adaf10b6048d80a8\\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'
"'"
'))'
egg_info--egg - base 'C:\Users\6110412\AppData\Local\Temp\pip-pip-egg-info-g8z9r58s'
cwd: C: \Users\ ** ** ** * \AppData\ Local\ Temp\ pip - install - al39ikfz\ libxml2 - python3_49a92dc4f1674927adaf10b6048d80a8\
Complete output(1 lines):
   failed to find headers
for libxml2: update includes_dir
   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Suggestion : 2

This issue tracker has been migrated to GitHub, and is currently read-only. For more information, see the GitHub FAQs in the Python's Developer Guide.

Installed Python 3.9 from Python.org
Tried installing lxml package using the command
   "pip install lxml"
It complains that it is unable to do so without libxml2(which is not a python package).I do not have the same issue with 3.8 .6.
There is no Python 3.9 compatible package on PyPI yet(https: //pypi.org/project/lxml/#files ).

      I guess you have to wait a bit more until there will be a new release.

      Also, this is the cpython issue tracker.When you have problems with a specific package, it is best to seek help at their issue tracker.For lxml this would be https: //launchpad.net/lxml

      Actually, there is already an issue on their tracker about support
      for Python 3.9 https: //bugs.launchpad.net/lxml/+bug/1892261

      I suggest to close this issue here.
Closing as third party.

Suggestion : 3

It is assumed that you have build-essential or at least clang, make and pkg-config installed. ,2 Python module installation tips and tricks 2.1 Advanced installation instructions 2.1.1 Tkinter 2.2 Installing Python modules from source ,When installing Python modules, it is highly recommended to have a package build-essential to be installed - some modules compile native extensions during their installation. ,matplotlib, pkg install matplotlib

In Termux Python v3.x can be installed by executing

pkg install python

Legacy, deprecated version 2.7.x can be installed by

pkg install python2

Installing a new Python module:

pip install {
   module name
}

Listing installed modules:

pip list

Tkinter is splitted of from the python package and can be installed by

pkg install python - tkinter