【问题标题】:SyntaxError: invalid syntax when installing graphiteSyntaxError:安装石墨时语法无效
【发布时间】:2016-09-28 06:44:17
【问题描述】:

我安装了以下内容: Graphite,Carbon,Whisper : 0.9.15,Django: 1.5,Python:Centos 6.7下的2.6.6。 成功启动Httpd后,文件中出现了同样的错误:error.log。 为什么以及如何解决它,感谢您的帮助。

谢谢。

[Tue Sep 27 16:08:38 2016] [error] warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')

[Tue Sep 27 16:08:38 2016] [error] [client ::1] mod_wsgi (pid=2761): Exception occurred processing WSGI script '/opt/graphite/conf/graphite.wsgi'.

[Tue Sep 27 16:08:38 2016] [error] [client ::1] Traceback (most recent call last):

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 255, in call
[Tue Sep 27 16:08:38 2016] [error] [client ::1] response = self.get_response(request)

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 178, in get_response

[Tue Sep 27 16:08:38 2016] [error] [client ::1] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 220, in handle_uncaught_exception

[Tue Sep 27 16:08:38 2016] [error] [client ::1] if resolver.urlconf_module is None:

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 342, in urlconf_module

[Tue Sep 27 16:08:38 2016] [error] [client ::1] self.urlconf_module = import_module(self.urlconf_name)

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module

[Tue Sep 27 16:08:38 2016] [error] [client ::1] __import_(name)

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/opt/graphite/webapp/graphite/urls.py", line 32, in 

[Tue Sep 27 16:08:38 2016] [error] client ::1,

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/conf/urls/init.py", line 25, in include

[Tue Sep 27 16:08:38 2016] [error] [client ::1] urlconf_module = import_module(urlconf_module)

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module

[Tue Sep 27 16:08:38 2016] [error] [client ::1] import(name)

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/opt/graphite/webapp/graphite/render/urls.py", line 16, in 

[Tue Sep 27 16:08:38 2016] [error] [client ::1] from . import views

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/opt/graphite/webapp/graphite/render/views.py", line 32, in 

[Tue Sep 27 16:08:38 2016] [error] [client ::1] from graphite.remote_storage import connector_class_selector

[Tue Sep 27 16:08:38 2016] [error] [client ::1] File "/opt/graphite/webapp/graphite/remote_storage.py", line 168

[Tue Sep 27 16:08:38 2016] [error] [client ::1] for series in unpickle.loads(pickled_response)

[Tue Sep 27 16:08:38 2016] [error] [client ::1] ^

[Tue Sep 27 16:08:38 2016] [error] [client ::1] SyntaxError: invalid syntax

【问题讨论】:

    标签: django graphite


    【解决方案1】:

    根据回溯 goto 行号破译。 168 的文件 /opt/graphite/webapp/graphite/remote_storage.py

    然后在 for 循环的末尾添加一个冒号 :。它应该可以解决您的问题。虽然这是一个快速修复,但我建议在此尝试成功后尝试重新安装石墨,因为在 github the file has different code on this line

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-10
      • 1970-01-01
      • 2017-09-09
      • 2021-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多