无法启动Carbon - 12.04 - Python错误 - ImportError:无法导入名称daemonize

Sha*_*ino 23 python bash caching macos-carbon

我真的希望有人可以帮助我,因为我花了至少15个小时试图解决这个问题.我被潜在的雇主给了我一个任务,我的解决方案是使用石墨/碳/收集.我正在尝试运行并安装碳/石墨0.9.12,但我根本无法启动碳.每次我尝试开始碳时,我都会遇到以下错误.我正在使用bash脚本进行安装以保持一致.

我根本不懂python,所以感谢您提供的任何帮助.

/etc/rc0.d/K20carbon-cache -> ../init.d/carbon-cache
/etc/rc1.d/K20carbon-cache -> ../init.d/carbon-cache
/etc/rc6.d/K20carbon-cache -> ../init.d/carbon-cache
/etc/rc2.d/S20carbon-cache -> ../init.d/carbon-cache
/etc/rc3.d/S20carbon-cache -> ../init.d/carbon-cache
/etc/rc4.d/S20carbon-cache -> ../init.d/carbon-cache
/etc/rc5.d/S20carbon-cache -> ../init.d/carbon-cache


Traceback (most recent call last):
File "/opt/graphite/bin/carbon-cache.py", 
line 28, in from carbon.util import run_twistd_plugin
File        "/opt/graphite/lib/carbon/util.py", 
line 21, in from twisted.scripts._twistd_unix import daemonize 
ImportError: cannot import name daemonize
Run Code Online (Sandbox Code Playgroud)

谢谢

巴蒂尔

小智 47

pip install 'Twisted<12.0'
Run Code Online (Sandbox Code Playgroud)

正如您在requirements.txt中看到的那样,较新版本的Twisted似乎不能很好地发挥它


Pau*_*ski 21

pip install daemonize
Run Code Online (Sandbox Code Playgroud)

然后我打开/opt/graphite/lib/carbon/util.py并更改了

from twisted.scripts._twistd_unix import daemonize
Run Code Online (Sandbox Code Playgroud)

import daemonize
Run Code Online (Sandbox Code Playgroud)

  • 我将回答我自己的问题,做:pip install Twisted == 11.1.0 (2认同)