$ python thread.py
starting at: 2015-08-05 00:24:24
Traceback (most recent call last):
  File "thread.py", line 28, in <module>
    main()
  File "thread.py", line 16, in main
    th = threading.Thread(target= test,args= (i,2))
AttributeError: 'module' object has no attribute 'Thread'
Exception AttributeError: '_shutdown' in <module 'threading' from '/home/tim/Desktop/sourceeeeeeeeeeeeeeee//threading.pyc'> ignored

Check that you have not named your script threading.py

8 down vote accepted

I bet you have a local file named threading.py, and it's masking the system threading module.

You can verify this by printing threading.__file__:

import threading
print threading.__file__

to get the file path of the module that is being imported.

Rename it, or delete it, to fix this.

AttributeError: 'module' object has no attribute 'Thread'的更多相关文章

  1. 'module' object has no attribute 'Thread'解决方法及模块加载顺序

    源码片段: class myThread(threading.Thread): def __init__(self, threadID, name, counter): threading.Threa ...

  2. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  3. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  4. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  5. 安装pandas报错(AttributeError: 'module' object has no attribute 'main')

    在pycharm中安装pandas出现报错:AttributeError: 'module' object has no attribute 'main', 刚开始以为是pip的版本太旧了,于是乎将其 ...

  6. AttributeError: 'module' object has no attribute 'enableTrace'

    Traceback (most recent call last): File "Long-lived-connection.py", line 29, in <module ...

  7. python问题:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

    AttributeError: 'module' object has no attribute 'SSL_ST_INIT' 问题背景: 下载工具wydomain,安装依赖包以后,出现下图问题. 几经 ...

  8. AttributeError: 'module' object has no attribute 'main'

    本机环境:ubuntu16.04,  ros-kinetic $ roscore 报错 Traceback (most recent call last): File , in <module& ...

  9. python问题:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'(转)

    原文地址:http://www.cnblogs.com/zhaijiahui/p/7344778.html AttributeError: 'module' object has no attribu ...

随机推荐

  1. iOS的扩展类,扩展属性

    Objective-C有两个扩展机制:Associative和Category.Category用来扩展类方法,Associative用于扩展属性.Associative机制的原理是把两个对象关联起来 ...

  2. C++ template学习二 类模板定义及实例化

    一个类模板(也称为类属类或类生成类)允许用户为类定义一种模式,使得类中的某些数据成员.默写成员函数的参数.某些成员函数的返回值,能够取任意类型(包括系统预定义的和用户自定义的). 如果一个类中数据成员 ...

  3. C++学习之嵌套类和局部类

    C++学习之嵌套类和局部类 局部类 在一个函数体内定义的类称为局部类. 局部类中只能使用它的外围作用域中的对象和函数进行联系,因为外围作用域中的变量与该局部类的对象无关.在定义局部类时需要注意:局部类 ...

  4. R与数据分析旧笔记(⑦)回归诊断

    回归诊断 回归诊断 1.样本是否符合正态分布假设? 2.是否存在离群值导致模型发生较大误差? 3.线性模型是否合理? 4.误差是否满足独立性.等方差.正态分布等假设条件? 5.是否存在多重共线性 正态 ...

  5. 5.7.2.1 Math对象

    ECMAScript还为保存数学公司公式和信息提供了一个公共位置,即Math对象.与我们在JavaScript直接编写的计算功能相比,Math对象提供的计算功能执行起来要快得多.Math对象中还提供了 ...

  6. 容易被误解的overflow:hidden

    http://www.ofcss.com/2011/03/20/misunderstood-of-overflow-hidden.html(转) 容易被误解的overflow:hidden 15条评论 ...

  7. Protel99se教程一:建立一个数据库文件

    学习Protel99 SE的第一步,是建立一个DDB文件,也就是说,使用protel99se进行电路图和PCB设计,以及其它的数据,都存放在一个统一的DDB数据库中的 一.打开protel 99se后 ...

  8. poj 1684 Lazy Math Instructor(字符串)

    题目链接:http://poj.org/problem?id=1686 思路分析:该问题为表达式求值问题,对于字母使用浮点数替换即可,因为输入中的数字只能是单个digit. 代码如下: #includ ...

  9. jQuery中on()方法用法实例详解

    这篇文章主要介绍了jQuery中on()方法用法,实例分析了on()方法的功能及各种常见的使用技巧,并对比分析了与bind(),live(),delegate()等方法的区别,需要的朋友可以参考下 本 ...

  10. 【iOS-Android开发对照】之 数据存储

    [iOS-Android开发对照]之 数据存储 写在前面的话 相比Android和iOS,我认为Android的数据存储更开放一些.Android天生就能够使用多Java I/O:并且天生开放的特性, ...