2013-05-24 15 views
25

私はPythonについてよく知らないです。私はこのプロジェクトの作業を開始したいと考えています。セットアップの指示は次のようになります。python NameError:名前 'file'が定義されていません

pip install -r requirements-dev.txt 

簡単なenougth。問題は私がこれを得ることです:

Downloading/unpacking gunicorn==0.13.4 (from -r requirements.txt (line 7)) 
    Running setup.py egg_info for package gunicorn 
    Traceback (most recent call last): 
     File "<string>", line 16, in <module> 
     File "/tmp/pip-build-root/gunicorn/setup.py", line 18, in <module> 
     long_description = file(
    NameError: name 'file' is not defined 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 

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

    File "/tmp/pip-build-root/gunicorn/setup.py", line 18, in <module> 

    long_description = file(

NameError: name 'file' is not defined 

私はこの問題を理解していません。多分誰かを助けることができますか?

私はこれをArch Linuxで実行しますが、pythonのデフォルトはpython 3で、プロジェクトはpython 3ではなく、わかりません。

ありがとうございました。

答えて

3

ファイルは、明らかに使用しているPython3では定義されていません。インストールしているパッケージはPython 3には適していませんが、Python 2.7をインストールしてもう一度やり直してください。

を参照してください:http://docs.python.org/release/3.0/whatsnew/3.0.html#builtins

+0

(OPは本当にPythonの3.xのを使用している場合)Gunicorn 0.13.4は、Python 2.xでは> = 2.5が必要です。出典:「インストール」のセクション:https://pypi.python.org/pypi/gunicorn/0.13.4 – cyroxx

6

をあなたのプロジェクトはこれが原因file()組み込み関数is removed in Python 3であるPythonの< 3で書かれているようです。 Python 2to3 toolまたはedit the erroneous file yourselfを試してみてください。

EDIT:ところで、project pageは明らかに

Gunicorn requires Python 2.x >= 2.5. Python 3.x support is planned.

+3

Pythonに慣れていないと主張する人のために、GunicornをPythonに移植しようとするのは悪い考えかもしれないと思う3 :)。それはうまくいきません。ここでPython 2.7を使用する方が良い方法です。 – Blubber

+0

私の悪い!私はそれらの言葉を逃した...申し訳ありません:( – mg007

関連する問題