2015-02-24 30 views
0

我在Ubuntu 14.04中使用虛擬環境Python3.4,並且我有一個運行Django webapp沒有任何問題。我希望能夠監視請求/交通等,但是當我嘗試安裝石墨的Web(通過運行PIP安裝VENV內石墨網)我得到以下幾點:Django與python3.4和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 graphite-web進行安裝,它會安裝,但它會顯示在python 2.7下。

現在我的問題是,有沒有一種方法可以讓這些東西一起工作(即使它們需要不同版本的python)?

+1

使用Python 2.7的一切? – 2015-02-24 21:31:40

+0

我不得不使用3.4。 – 2015-02-24 22:06:59

+0

然後,您必須將Graph-Web作爲依賴關係放下,或者自行更新爲Python3兼容。抱歉。 – 2015-02-24 22:21:22

回答

2

它看起來像graphite-web目前沒有Python 3支持(請參閱check-dependencies腳本)。你必須用Python 2.7來運行它。

+0

你好阿拉斯代爾,謝謝你的回覆。你能否指出我的方向是正確的,因爲我不知道如何將它們放在一起運行(正如我剛纔提到的,我在3.4版的venv上運行django)。 – 2015-02-24 22:05:56

+1

您可以用Python 2.7創建一個新的venv,並在其中安裝Django和graphite-web。直到您或其他人將Python 3支持添加到graphite-web,您沒有任何其他選項。 – Alasdair 2015-02-24 23:47:48