Unable to install python-docx
Solution 1
This is a problem with the lxml
install. If you install lxml
separately, using a Windows binary package, then reinstall python-docx, this error should go away.
You can find a binary lxml
package here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
Solution 2
I had the same issue. I was not able to install the lxml wheel for 64 machine because python falsely identifies my computer as 32. Ultimately installed the 32 and then it installed python-docx successfully. FYI: I would have added this to comments but I don’t have the 50 required reputation to do so.
Ree
Updated on June 14, 2022Comments
-
Ree about 2 years
I need to create table in a Word document through Python 3.4. For that, I am trying to install
python-docx
in Windows. If I usepip install python-docx
I am getting the following error:vcvarsall.bat error
So I installed Visual Studio and then tried to install it and I am still getting the following :
error: Setup script exited with error: command '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe"' failed with exit status 2
-
nneonneo over 9 years...any other error messages? Have you tried to find a prebuilt version for your OS?
-
Ree over 9 yearsNo.. how is that ? Any other option to print the output in table format using python 3.4 ?
-
jpmc26 over 9 years
vcvarsall.bat
is a Microsoft C++ compiler. The error means thatsetuptools
can't find a compiler installed on your machine. Normally, I find a Windows binary and use this command, but without an existing Windows binary, you might have to build from source yourself. -
jpmc26 over 9 yearsHang on. It looks like the native dependency might be
lxml
. If so, the error comes from installinglxml
, notpython-docx
. What happens if you installlxml
from here using the command I mentioned above before installingpython-docx
? -
Martijn Pieters over 9 yearsPossible dupe of error: Unable to find vcvarsall.bat
-
-
scanny over 9 yearsSince this worked for you, please accept the answer and click the up-arrow to endorse it if it was a help :)
-
Benjamin about 4 yearsWhen trying to install either the 32-bit or the 64-bit version of the .whl files with pip in Windows 10 I get an error message saying that the .whl is not a supported wheel on this platform.