'Getting error while trying "pip install python-docx" in pycharm terminal
New to python and just trying pip install python-docx and getting this message:
Command "C:\Users\samue\PycharmProjects\testings\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file __='C:\Users\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml\setup.py';f=getattr(tokenize, 'open', open )(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\samue\AppData\Local\Temp\pip-record-pg5bpdaa\install-record.txt --single-version-externally-managed --com error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\bin\Hos tX86\x86\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\samue\PycharmProjects\testings\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users
\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().re
place('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\samue\AppData\Local\Temp\pip-reco
rd-pg5bpdaa\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\samue\PycharmProjects\te
stings\venv\include\site\python3.8\lxml" failed with error code 1 in C:\Users\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml
\
Solution 1:[1]
When you install with pip you use the command pip and not python.
To see whether pip is correctly installed type:
pip help
See the following page for how to install and configure pip on Windows:
https://phoenixnap.com/kb/install-pip-windows
Your error output shows a problem with lxml. Looking into it I have found the page pip install lxml error which suggests the following solution:
sudo apt-get install --reinstall python-dev libpython2.7-dev.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
