程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

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,修改後即可

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved