PyThon Debug mining pit -- prompt module thread has no attribute start_new_thread
編輯:Python
PyThon Debug
C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_resolver.py:127: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if found.get(name) is not 1:
pydev debugger: starting
Connected to pydev debugger (build 181.5540.7)
Traceback (most recent call last):
File "C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\pydevd.py", line 1664, in <module>
main()
File "C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\pydevd.py", line 1044, in run
self.prepare_to_run()
File "C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\pydevd.py", line 962, in prepare_to_run
self.patch_threads()
File "C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\pydevd.py", line 983, in patch_threads
patch_thread_modules()
File "C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_monkey.py", line 656, in patch_thread_modules
patch_thread_module(t)
File "C:\Users\Administrator\.IntelliJIdea2018.1\config\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_monkey.py", line 622, in patch_thread_module
_original_start_new_thread = thread._original_start_new_thread = thread.start_new_thread
AttributeError: module 'thread' has no attribute 'start_new_thread'
There is the above error message,表示的意思是thread方法中沒有start_new_thread的屬性
Searching online gives the answer:包含了thread.pyThe file has the same name as the system file,重命名一下即可
經過排查後,It was found that there is indeed no corresponding in the filethread.py,But there is a package namethread,修改後即可