【问题标题】:Django with python3.4 and Graphite-web带有 python3.4 和 Graphite-web 的 Django
【发布时间】:2015-02-24 20:35:49
【问题描述】:

我在 Ubuntu 14.04 中使用虚拟环境 Python3.4,并且我的 Django webapp 运行没有任何问题。我希望能够监控请求/流量等,但是当我尝试安装 Graphite-Web(通过在 venv 中运行 pip install Graphite-web)时,我得到以下信息:

Collecting graphite-web
  Using cached graphite-web-0.9.13.tar.gz
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-koiz44ft/graphite-web/setup.py", line 63, in <module>
        data_files=webapp_content.items() + storage_dirs + conf_files + examples,
    TypeError: unsupported operand type(s) for +: 'dict_items' and 'list'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

      File "<string>", line 20, in <module>

      File "/tmp/pip-build-koiz44ft/graphite-web/setup.py", line 63, in <module>

        data_files=webapp_content.items() + storage_dirs + conf_files + examples,

    TypeError: unsupported operand type(s) for +: 'dict_items' and 'list'

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-koiz44ft/graphite-web

看起来这是由于 python 版本,因为如果我退出 venv(停用)并尝试使用 sudo apt-get install graphe-web 安装,它会安装但它显示在 python 2.7 下。

现在我的问题是,有没有办法让这些东西一起工作(即使它们需要不同版本的 python)?

【问题讨论】:

  • 一切都使用 Python 2.7?
  • 不幸的是,我必须使用 3.4。
  • 那么你必须要么放弃graphite-web作为依赖,要么自己去更新它以兼容Python3。对不起。

标签: python django python-2.7 python-3.x graphite


【解决方案1】:

目前,graphite-web 似乎不支持 Python 3(请参阅 check-dependencies 脚本)。您必须使用 Python 2.7 运行它。

【讨论】:

  • 您好 Alasdair,感谢您的回复。你能指出我正确的方向吗,因为我不知道如何将它们一起运行(正如我所提到的,我有 django 在 venv 上运行,即 3.4)。
  • 您可以使用 Python 2.7 创建一个新的 venv 并在其中安装 Django 和石墨网络。在您或其他人将 Python 3 支持添加到graphite-web 之前,您没有任何其他选择。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-15
相关资源
最近更新 更多