7

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.

Arount
  • 9,853
  • 1
  • 30
  • 43
Irum Zahra Awan
  • 276
  • 1
  • 5
  • 16
  • If the exact same command on the exact same code do not work today, it's surely a `virtualenv` issue. If you are using it, you have to "load" it by: `source /bin/activate`. `` is usually called `env`, but can be anything else (it's the name you set when doing first `virtualenv `) – Arount Dec 07 '16 at 08:34
  • `./.conda/envs/.pkgs/python-2.7.12-1/bin/python ./.conda/envs/tensorflow/bin/python ./.conda/envs/tensorflow_env/bin/python ./.conda/envs/tensorflow_env/lib/python2.7/site-packages/tensorflow/python ./OpenCv/release/modules/python ./OpenCv/modules/python ./OpenCv/Release/modules/python ./OpenCv/samples/python` i dont get which env to activate – Irum Zahra Awan Dec 07 '16 at 08:43
  • but before that i never activated any virtualenv ever.... it was working fine without any activation or deactivation – Irum Zahra Awan Dec 07 '16 at 09:37
  • So, add your code and the command you use to launch it. – Arount Dec 07 '16 at 21:00

1 Answers1

38

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.

Anirudh Gupta
  • 501
  • 4
  • 4