0

Hi I'm using windows 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.7 is installed. Does anyone know why whis is happening?

Update : I just found out the script runs when i run the script on windows command line, but it doesn't run on IDLE could it be some configurations on IDLE?

Pang Ren Tan
  • 3
  • 1
  • 5

2 Answers2

0

It is not Documents just Document

It should just be:

from docx import Document

Also here is an example from the documentation:

Documentation for command

0

Just in case if someone is still having problem, please update your setuptools and install python-docx.

pip install -U setuptools

pip install --pre python-docx

Black Mask
  • 387
  • 1
  • 3
  • 16