开始在QThread上被RLock踩踏

时间:2013-12-15 11:00:58

标签: pyqt pyqt4 pyside qthread

您好我没有使用PyQt线程的经验,这是我第一次尝试使我的现有应用程序多线程,

但是我收到了这个错误:

Traceback (most recent call last):
  File "~/Development/python/slideShow/python/gallery.py", line 3, in <module>
    import utils
  File "~/Development/python/slideShow/python/utils.py", line 3, in <module>
    import exifread
  File "build/bdist.macosx-10.7-intel/egg/exifread/__init__.py", line 1, in <module>

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 206, in <module>
    _lock = threading.RLock()
AttributeError: 'module' object has no attribute 'RLock'
Exception AttributeError: '_shutdown' in <module 'threading' from '~/Development/python/slideShow/python/threading.pyc'> ignored

我不明白的是,当我没有触发将执行在不同线程中启动图库的方法的事件时,那么在运行主应用程序时该错误是怎么出现的呢?

1 个答案:

答案 0 :(得分:0)

您已在项目threading~/Development/python/slideShow/python/threading.py)中命名了一个模块。这将影响python的threading模块,logging模块试图访问该模块。

只需将模块重命名为其他内容即可。选择与python的标准库模块冲突的模块名称总是一个坏主意。