title: How to fix 'ImportError: dynamic module does not define module export function (PyInit_cv2)' error in Python?
body: <p>I'm running a code on deep learning, which uses the opencv module, by running <code>python main.py</code> (contains <code>import cv2</code> statement), but always get the error <code>'ImportError: dynamic module does not define module export function (PyInit_cv2)'</code>.</p>
  
  <p>I've tried to reinstall my anaconda and create new virtual environments, but all got the same result. This problem really confuses me a lot and I've googled for many related problems, none of them works. I think the problem is something related to the environment and has nothing to do with the code, because I got the same result by simply run <code>import cv2</code> in python prompt. The more confusing thing is that, even after I remove the opencv module, I also get the same problem, but not a <code>ModuleNotFoundError</code>. Does anyone can give me some advice? Thanks a lot!</p>