0

I found many questions on this site realized with this problem but none of them was helpful. I uninstalled docx and install the latest version of python-docx, but still getting this error:

C:\Users\Admin\Desktop\bluetooth_control\Deutsch\ofline version>py Spliter.py
Traceback (most recent call last):
  File "Spliter.py", line 2, in <module>
    import docx
ModuleNotFoundError: No module named 'docx'
C:\Users\Admin>python
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import docx
>>>

But when i try to import docx module i get no error. Sublimetext is also displaing this error? Why?

4
  • 1
    Is your py --version different from your python --version? Commented Apr 16, 2020 at 11:18
  • Yes. My py version is 3.7.5 and my python version is 3.8.2. Should they be the same version? Commented Apr 16, 2020 at 11:20
  • 1
    You've likely installed python-docx for one but not the other. Commented Apr 16, 2020 at 11:20
  • Yes, that has worked, but SublimText is displaying the same error, although I am errorfree when i use terminal. What should I do to prevent the error from SublimText? Commented Apr 16, 2020 at 11:30

1 Answer 1

1

It is highly likely that you have installed docx module only for py, not for python. Try this:

python -m pip install python-docx
py -m pip install python-docx
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.