美文网首页
AttributeError: module 'threadin

AttributeError: module 'threadin

作者: furuiyang | 来源:发表于2018-04-24 18:25 被阅读0次
    /home/python/.virtualenvs/django_py3/bin/python /home/python/Desktop/demo/tcp/threading.py
    Traceback (most recent call last):
      File "/home/python/Desktop/demo/tcp/threading.py", line 30, in <module>
        main()
      File "/home/python/Desktop/demo/tcp/threading.py", line 22, in main
        t1 = threading.Thread(target=download_music)
    AttributeError: module 'threading' has no attribute 'Thread'
    Exception ignored in: <module 'threading' from '/home/python/Desktop/demo/tcp/threading.py'>
    AttributeError: module 'threading' has no attribute '_shutdown'
    
    Process finished with exit code 1
    
    

    写了一个线程的demo,名字叫threading.py,在程序中使用了threading.Thread,报错。
    原因是自己编写的文件和系统中的文件名重名,优先使用了自己写的threading文件。

    相关文章

      网友评论

          本文标题:AttributeError: module 'threadin

          本文链接:https://www.haomeiwen.com/subject/etgjlftx.html