pycharm cannot debug with ModuleNotFound error


I have a which could be run normally. Somehow the cannot be debugged but can run without any problem.

I have tried:

  • re-install the pycharm from scratch, and delete all the settings and config
  • delete all breakpoints

The pycharm version is community edition 2017.2.4. The OS is windows7 64bit. The error log is:

D:\Users\dongb4\AppData\Local\Programs\Python\Python36\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\" --multiproc --qt-support=auto --client --port 56027 --file D:/project/auto-handle/
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\", line 13, in <module>
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PY3K, IS_PY34_OR_GREATER, get_thread_id, dict_keys, dict_contains, \
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\_pydevd_bundle\", line 147, in <module>
from _pydev_imps._pydev_saved_modules import thread
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\_pydev_imps\", line 21, in <module>
import xmlrpc.client as xmlrpclib
File "D:\Users\dongb4\AppData\Local\Programs\Python\Python36\lib\xmlrpc\", line 136, in <module>
import http.client
File "D:\Users\dongb4\AppData\Local\Programs\Python\Python36\lib\http\", line 71, in <module>
import email.parser
ModuleNotFoundError: No module named 'email.parser'; 'email' is not a package

Comment actions Permalink

Jesus. It just because there is a file named which conflicted with the module email. There is no indication of this. I waste the whole day to figured out this!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Comment actions Permalink

It's worth discussing whether PyCharm should warn you if you name a module with the same name as something from the standard library or something you installed as a package. Although the latter can be tricky, as some packages do dynamic monkeying around with package names.

Stated differently, what do you think PyCharm should have done to warn you about your Python mistake?

Comment actions Permalink

That's a bogus answer. When a program runs directly but doesn't run in the debugger, that's a mistake in the debugger.

Comment actions Permalink

>  It just because there is a file named which conflicted with the module email. There is no indication of this.

Totally agree with you. It would be great if you could describe this in same details & submit at


Please sign in to leave a comment.