-2

I'm using mac and installing python-docx using pip. I went into C:\Python27\Scripts and ran

pip install python-docx

I thought it should have been installed.

But when i run a simple import

from docx import Documents

it ran into an

ImportError: No module named docx  

when i checked the modules installed using pip using pip list python-docx 0.8.11 is installed.

Why is this happening?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • The same `python` you use to install python-docx should be the same `python` you use to run your app/script: `python -m pip install python-docx`. Or better, use a virtual environment, then install and run from inside the venv. – Gino Mempin May 19 '23 at 23:53

1 Answers1

0

please try to install the python-docx :

$ pip uninstall docx
$ pip install python-docx
Abilogos
  • 4,777
  • 2
  • 19
  • 39