I am workin on face detection with Open CV PYTHON. my whole code was working fine yesterday and today i am getting this error.
['/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'
i have tried updating numpy also i reinstall it but nothong is workin.
To solve the Python "AttributeError: module has no attribute", make sure you haven't named your local modules with names of remote modules, e.g. datetime.py or requests.py and remove any circular dependencies in import statements.
It's simply because there is no attribute with the name you called, for that Object. This means that you got the error when the "module" does not contain the method you are calling.
If it helps someone, I had the exact same problem. Code running till one day and then suddenly this error. What had changed was that I had made a file called threading.py in the same directory. Threading is a also a library name. Which created conflicts and all code was breaking. Just removing threading.py solved it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With