我正在尝试使用 zope 配置 newrelic,但它返回错误:

# bin/newrelic-admin run-python bin/zeoserver fg

Traceback (most recent call last):
  File "bin/zeoserver", line 22, in <module>
import plone.recipe.zeoserver.ctl
  File "/opt/bitnami/apps/plone/buildout-cache/eggs/plone.recipe.zeoserver-1.2.6-py2.7.egg/plone/recipe/zeoserver/__init__.py", line 9, in <module>
    import zc.recipe.egg
  File "/opt/bitnami/apps/plone/buildout-cache/eggs/zc.recipe.egg-1.3.2-py2.7.egg/zc/recipe/egg/__init__.py", line 1, in <module>
    from zc.recipe.egg.egg import Egg, Scripts, Eggs
  File "/opt/bitnami/apps/plone/buildout-cache/eggs/zc.recipe.egg-1.3.2-py2.7.egg/zc/recipe/egg/egg.py", line 21, in <module>
    import zc.buildout.easy_install
  File "/opt/bitnami/apps/plone/buildout-cache/eggs/zc.buildout-2.2.5-py2.7.egg/zc/buildout/easy_install.py", line 81, in <module>
    pkg_resources.Requirement.parse('zc.buildout')).location,
AttributeError: 'NoneType' object has no attribute 'location'

有谁知道它可以是什么?

最佳答案

我解决了在应用程序的 __init__.py 中添加以下代码:

import newrelic.agent
newrelic.agent.initialize('path/of/newrelic.ini')

并在没有命令“newrelic-admin run-python”的情况下执行应用程序。

Newrelic 工作但有限制,因为还没有官方支持。

关于python - newrelic 和 zope 错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33534108/

10-12 18:15