Search code examples
python-3.xwindowspippython-docx

Can't install python-docx using pip


I am very new to python and programming in generall. I am following a tutorial and tried to install python-docx using pip in the cmd, but it doesn't work. Those are the errors i see:

DEPRECATION: lxml is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for lxml ... error
  error: subprocess-exited-with-error

and

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> lxml

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Can somebody help me with that problems in a way that even a newcomer like me understands it ?

I tried it with >pip install python-docx and >pip install python-docx==0.8.11 in the cmd.


Solution

  • I found a solution. It worked after installing a manual build windows x64 wheel for python 3.11. See github_lxml/lxml#356