1

私はまだPythonとDjangoにかなり慣れていないので、我慢してください

作業中のプロジェクトを大学のPCからUSBにコピーし、それをラップトップにロードして、cmdで次のコードを使用して実行しようとすると次のようになります。python manage.py runserver

このエラーが発生しました:

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x01D4EB70>>
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 91, in inner_run
    self.validate(display_num_errors=True)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 270, in validate
    raise CommandError("One or more models did not validate:\n%s" % error_text)
django.core.management.base.CommandError: One or more models did not validate:
groupcraft.userprofile: "picture": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/

誰かが私に何が間違っているのか、私が何をしていないのか教えてもらえますか?

4

2 に答える 2

3

1 つ以上のモデルが検証されませんでした: groupcraft.userprofile: "picture": ImageFields を使用するには、Python Imaging Library をインストールする必要があります。http://www.pythonware.com/products/pil/で入手してください。

モデルの 1 つで Django を使用ImageFieldしており、PIL に依存しています。PIL 用の Windows インストーラーをダウンロードしてインストールできます(Python のバージョンに基づいて正しいファイルを選択してください)。

于 2013-02-27T18:11:52.107 に答える
1

最新の PIL バージョンの場合は、次のように入力します。

easy_install http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe

すべての Python ライブラリが含まれていることを確認するために、既存のプロジェクト内の "requirements.txt" ファイルを常にチェックする必要があります。

Windows で作業する場合、これらのライブラリの一部のバイナリ バージョンをインストールする必要があります。

于 2013-03-01T12:11:23.380 に答える