我正在尝试将python脚本作为守护进程运行,并且在尝试导入运行器模型时我遇到了这个问题:
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from daemon import runner
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/python_daemon-1.5.5-py2.6.egg/daemon/runner.py", line 25, in <module>
import pidlockfile
File "/usr/local/lib/python2.6/dist-packages/python_daemon-1.5.5-py2.6.egg/daemon/pidlockfile.py", line 33, in <module>
class PIDLockFile(LinkFileLock, object):
TypeError: Error when calling the metaclass bases
function() argument 1 must be code, not str
我正在使用Debian 6.0进行编程,并通过apt手动安装了python-daemon和lockfile,但没有任何改变。有什么想法吗?
此致,,,
答案 0 :(得分:2)
python-daemon
的版本似乎与lockfile
的版本不兼容。这可能发生在pypi上。如果您不关心最新版本,请删除两者的手动安装版本并依赖python-daemon
包。只要您在回溯中看到/usr/local
,就不会使用Debian的版本。