Closed petey8 closed 5 years ago
I had this problem. It was that I called my project Mailmerge and my pyfile mailmerge.py Once I renamed those, the problem was solved. Doh!
I had this problem and I found two possible solutions:
_For whoever might find this on search, this error is raised when trying to use the python-docx v0.3.0+ API on docx v0.2.x or prior versions.
The solution, assuming you want to use the newer version, is to uninstall the docx package and install python-pptx, perhaps something like this:
$ pip uninstall docx $ pip install python-docx_
Hope it helps
Nothing works for me, is there any other solution?
Hi WeidnersApps, Did you find the solution?
This bit me because I ran pip install mailmerge
instead of pip install docx-mailmerge
. Make sure you have the correct package installed.
worked for me.
pip uninstall mailmerge pip install docx-mailmerge
then run your script:
python script.py
Nothing works for me as well.. I'm using PyCharm to run the code.
Traceback (most recent call last): File "C:/Users/Lode/PycharmProjects/WestFitMutualiteit/WestFitMutualiteit.py", line 2, in
from mailmerge import MailMerge ModuleNotFoundError: No module named 'mailmerge'
sounds like an environment issue. make sure PyCharm is using the correct python interpreter.
import sys print(sys.version)
for path in sys.path: print(path)
this should print a list of directories where Python searches for modules.
if you navigate these directories, you should be able to find mailmerge there. if PyCharm is using the wrong python interpreter, you need to point it to the correct one
sounds like an environment issue. make sure PyCharm is using the correct python interpreter.
import sys print(sys.version)
for path in sys.path: print(path)
this should print a list of directories where Python searches for modules.
if you navigate these directories, you should be able to find mailmerge there. if PyCharm is using the wrong python interpreter, you need to point it to the correct one
Seems like you are right. Had to do some more configuring of PyCharm. Works perfectly now. Thanks for the support!
So, this is not an issue with mailmerge, and can be closed.
Hi Bouke and Joaoe,
I don't think it's an environment issue. I'm using Jupyter on Azure notebooks. I get the same error and none of the suggested solutions worked by far. I appreciate if you reopen the post so we can benefit from other people's recommendations.
Thanks, M
I had this problem and I found two possible solutions:
- As user scanny mentioned:
For whoever might find this on search, this error is raised when trying to use the python-docx v0.3.0+ API on docx v0.2.x or prior versions. The solution, assuming you want to use the newer version, is to uninstall the docx package and install python-pptx, perhaps something like this: $ pip uninstall docx $ pip install python-docx
- And probably similar issue (that worked for me): $ pip uninstall mailmerge $ pip install docx-mailmerge
Hope it helps
Thanks
I have the latest version of python installed on my macOS and installed the latest docx-mailmerge via the terminal but keep getting this error when trying to import it in my python shell:
I think this is an easy to fix error, but I can't figure out what the problem is.. I'm new to python so any advice would be appreciated!!
Thanks!