Python Forum

Full Version: no module named 'docx' when importing docx
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When i run
import docx
i get
Error:
ModuleNotFoundError: No module named 'docx'
.

In the windows prompt i executed
Output:
(venv) C:\Users\Username>pip install python-docx Requirement already satisfied: python-docx in c:\users\Username\venv\lib\site-packages (1.1.0) Requirement already satisfied: lxml>=3.1.0 in c:\users\Username\venv\lib\site-packages (from python-docx) (5.0.0) Requirement already satisfied: typing-extensions in c:\users\Username\venv\lib\site-packages (from python-docx) (4.9.0)
What is going wrong?
Are you using a virtual environment? If so, did you activate the virtual environment before running pip install python-docx?