zoukankan      html  css  js  c++  java
  • pycharm 'AttributeError: module 'thread' has no attribute 'start_new_thread''

     
    /Users/cloud/.conda/envs/auto/bin/python /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 56745 --file /Users/cloud/Downloads/project_static/PD/series.py
    pydev debugger: process 4872 is connecting
    
    Connected to pydev debugger (build 202.7660.27)
    Traceback (most recent call last):
      File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2141, in <module>
        main()
      File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 2132, in main
        globals = debugger.run(setup['file'], None, None, is_module)
      File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1403, in run
        self.prepare_to_run()
      File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1291, in prepare_to_run
        self.patch_threads()
      File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1307, in patch_threads
        patch_thread_modules()
      File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 854, in patch_thread_modules
        patch_thread_module(t)
      File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_monkey.py", line 817, in patch_thread_module
        _original_start_new_thread = thread_module._original_start_new_thread = thread_module.start_new_thread
    AttributeError: module 'thread' has no attribute 'start_new_thread'
    
    Process finished with exit code 1

    出现如上述提示

    模块“线程”没有属性“ start_new_thread”

    有两种情况:

    1.模块中没有这个属性。

    2.项目中有包名thread(python中文件夹名也是包名),与系统的thread库冲突了,把项目中的文件夹改名即可

  • 相关阅读:
    OO术语表
    linux之用户管理(useradd/usermod/userdel/groupadd/groupmod/groupdel)
    Linux 线程绑核
    g++中数组定义时长度可以使用变量
    水滴石穿之C语言的底层操作(移位操作有效位数)
    ACE
    Oracle优化器介绍
    SQL优化工具
    Oracle Index 索引介绍(SQL)
    VC6.0:"Setup was unable to create a DCOM user account"的解决方案
  • 原文地址:https://www.cnblogs.com/a00ium/p/13962522.html
Copyright © 2011-2022 走看看