-3

I am new to python but recently downloaded a module from a third party called docx. When I try to import the library I get the following error:

no module named docx.

I am unable to use any module from site_packages with the same error, however when I look at the libraries in PyCharm the modules are there. I have tried fixing common errors like checking the file path etc. but still can't resolve the issue.

cant use docx module I recently installed or any module from site_packages

bad_coder
  • 11,289
  • 20
  • 44
  • 72
J_maker
  • 1
  • 2
  • 1
    Is PyCharm using the expected version of Python? Oftentimes the problem is PyCharm is looking in a different place. Try running your code with `import sys`, `print(sys.executable)` both in PyCharm and at the command line, and you may see two different installs. – ShadowRanger Aug 30 '21 at 17:58
  • I can't read the blue hand written text on dark grey background. – mkrieger1 Aug 30 '21 at 19:12
  • Hi there thank you for the advice, I've made sure that only one version of python is installed . The blue text highlights the error which is "no module named Docx " still trying to troubleshoot the issue. – J_maker Sep 02 '21 at 18:47

1 Answers1

0

Are you sure that error was about docx module ? When I've installed docx and tried to import it, I got exception that another its dependency is missing.

ModuleNotFoundError: No module named 'exceptions'

And here is the old discussion abut this problem. When import docx in python3.3 I have error ImportError: No module named 'exceptions'

In my case pip installed version 0.2.4. I've uninstalled it and installed "python-docx"

pip3 install python-docx

docs: https://python-docx.readthedocs.io/en/latest/user/quickstart.html

and now I can import docx.

poleszcz
  • 145
  • 9
  • Hi there thank you for the advice , i've tried to uninstall pip and install docx but still not working will have to eliminate other possibilites – J_maker Sep 02 '21 at 18:41