Reputation: 573
Trying to install python-docx through pip for 'Learn to Automate the Boring Things with Python'. I am getting errors like this.
I have Googled up some solutions to this issue, but they don't seem to work for me, or I am not deploying the solution correctly.
One post on Stackoverflow said to download an lxml file made available by Christoph Golke.
I downloaded, and then tried 'pip install lxml', and basically got the same error message as the screenshot, telling me 'Unable to find vcvarsall.bat'.
Am I supposed to put this file in a certain directory, before executing that command? Any help would be appreciated.
Upvotes: 1
Views: 1022
Reputation: 573
so I found the answer to this issue.
So I wasn't aware that to install the lxml file, you first need to change to the directory of that file, and type in the complete name of that file. Either that, or typing the path of the lxml file directly into the cmd prompt, like:
pip install C:\Users\yourName\Downloads\lxml-3.6.4-cp35-cp35m-win32
or
cd C:\Users\yourName\Downloads
pip install lxml-3.6.4-cp35-cp35m-win32
which successfully installed the lxml file, which then led to a successful installation of the python-docx file.
Essentially, a basic knowledge of the command prompt would've helped me avoid this problem...but hope this helps for anyone else who doesn't know what to do!
Upvotes: 0
Reputation: 26698
This mean that C++ Common Tools are not installed.
To install them for Python2.7 go to Microsoft Visual C++ Compiler for Python 2.7
For python3 install Visual Studio Community 2015
and execute the following command:
SET VS90COMNTOOLS=%VS140COMNTOOLS%
Upvotes: 1