AttributeError:'module'对象没有属性'RLock'

时间:2016-12-07 07:58:01

标签: python-2.7 opencv numpy face-detection

我正在使用Open CV PYTHON进行面部检测。我的整个代码昨天工作正常,今天我收到了这个错误。

['/usr/local/lib/python2.7/dist-packages/numpy']
 Traceback (most recent call last):
  File "facerec-opencv.py", line 2, in <module>
  from scipy.misc import imread
  File "/usr/local/lib/python2.7/dist-packages/scipy/__init__.py", line 61,in <module>
  from numpy import show_config as show_numpy_config
  File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 163, in <module>
  from . import random
  File "/usr/local/lib/python2.7/dist-packages/numpy/random/__init__.py", line 99, in <module>
  from .mtrand import *
  File "mtrand.pyx", line 149, in init mtrand (numpy/random/mtrand/mtrand.c:37623)
  File "/home/irum/Desktop/Face-Recognition/thakarrecog/threading.py", line 6, in <module>
  import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 201, in <module>
    _lock = threading.RLock()
AttributeError: 'module' object has no attribute 'RLock'

我试过更新numpy也重新安装它但是nothong正在工作。

1 个答案:

答案 0 :(得分:0)

如果它可以帮助某人,那么我也有同样的问题。代码运行到一天,然后突然出现此错误。发生的变化是,我在同一目录中创建了一个名为threading.py的文件。线程也是一个库名。这就造成了冲突,所有代码都被破坏了。只需删除threading.py即可为我解决。