2

私はUbuntu 10.04で作業しています。私のマシンのデフォルトのpythonは2.6です。Python 2.7 で virutalenv を作成しました。googleappengine で実行する django アプリを作成しています。モデルの 1 つで ImageField を使用するには、PIL をインストールする必要があります。PIL のインストールに関する投稿は非常に多く、私はそれらの多くをたどってきましたが、成功していません。

正常に実行できます

sudo pip install PIL

しかし、私の仮想環境はそれにアクセスできません。私が走るとき

pip install PIL

virtualenv 内で gcc エラーが発生します。

すべての依存関係をインストールし、apt-get で python-imaging をインストールし、PIL をダウンロードして、setup.py でビルド/インストールを試み、読んだ多くの投稿の他の多くの指示に従いました。

誰にもアイデアはありますか?

編集:

エラー:

エラー: コマンド 'gcc' が終了ステータス 1 で失敗しました

編集:貼り付けることができる限りのエラー(残りは画面外にあります)

 _imaging.c:301: error: ‘PyExc_IOError’ undeclared (first use in this function)

_imaging.c:302: error: ‘NULL’ undeclared (first use in this function)

_imaging.c: In function ‘ImagingError_MemoryError’:

_imaging.c:308: warning: implicit declaration of function ‘PyErr_NoMemory’</p>

_imaging.c:308: warning: return makes pointer from integer without a cast

_imaging.c: In function ‘ImagingError_Mismatch’:

_imaging.c:314: error: ‘PyExc_ValueError’ undeclared (first use in this function)

_imaging.c:315: error: ‘NULL’ undeclared (first use in this function)

_imaging.c: In function ‘ImagingError_ModeError’:

_imaging.c:321: error: ‘PyExc_ValueError’ undeclared (first use in this function)

_imaging.c:322: error: ‘NULL’ undeclared (first use in this function)

_imaging.c: In function ‘ImagingError_ValueError’:

_imaging.c:329: error: ‘PyExc_ValueError’ undeclared (first use in this function)

_imaging.c:332: error: ‘NULL’ undeclared (first use in this function)

_imaging.c: In function ‘ImagingError_Clear’:

_imaging.c:338: warning: implicit declaration of function ‘PyErr_Clear’</p>

_imaging.c: At top level:

_imaging.c:369: error: expected ‘)’ before ‘*’ token

_imaging.c:464: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:510: error: expected ‘)’ before ‘*’ token

_imaging.c:587: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:619: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:631: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:643: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:655: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:664: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:675: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:686: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:697: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:719: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:743: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:760: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:777: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:786: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:803: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:813: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:824: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:857: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:879: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:914: error: expected ‘)’ before ‘*’ token

_imaging.c:954: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:981: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1054: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1065: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1075: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1114: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1191: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1202: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1339: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1359: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1394: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1419: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1448: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1459: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1479: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1530: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1568: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1614: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1689: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1739: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1765: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1771: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1783: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1817: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1845: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1874: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1885: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1901: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1922: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1928: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1939: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1950: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1961: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1972: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:1983: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2001: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2019: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2030: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2041: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2052: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2063: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2081: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c: In function ‘_font_dealloc’:

_imaging.c:2142: warning: implicit declaration of function ‘Py_XDECREF’</p>

_imaging.c:2142: error: ‘ImagingFontObject’ has no member named ‘ref’</p>

_imaging.c: In function ‘textwidth’:

_imaging.c:2152: error: ‘ImagingFontObject’ has no member named ‘glyphs’</p>

_imaging.c: At top level:

_imaging.c:2157: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2205: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2215: error: array type has incomplete element type

_imaging.c:2216: error: ‘PyCFunction’ undeclared here (not in a function)

_imaging.c:2216: error: expected ‘}’ before ‘_font_getmask’</p>

_imaging.c:2217: error: expected ‘}’ before ‘_font_getsize’</p>

_imaging.c:2218: error: ‘NULL’ undeclared here (not in a function)

_imaging.c:2221: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2229: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c: In function ‘_draw_dealloc’:

_imaging.c:2257: error: ‘ImagingDrawObject’ has no member named ‘image’</p>

_imaging.c: At top level:

_imaging.c:2261: error: expected ‘)’ before ‘*’ token

_imaging.c:2263: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2278: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2298: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2335: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2353: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2390: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2406: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2459: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2474: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2507: error: expected ‘)’ before ‘*’ token

_imaging.c:2509: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2536: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2554: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2600: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2637: error: array type has incomplete element type

_imaging.c:2640: error: expected ‘}’ before ‘_draw_line’</p>

_imaging.c:2641: error: expected ‘}’ before ‘_draw_lines’</p>

_imaging.c:2643: error: expected ‘}’ before ‘_draw_outline’</p>

_imaging.c:2645: error: expected ‘}’ before ‘_draw_polygon’</p>

_imaging.c:2646: error: expected ‘}’ before ‘_draw_rectangle’</p>

_imaging.c:2647: error: expected ‘}’ before ‘_draw_point’</p>

_imaging.c:2648: error: expected ‘}’ before ‘_draw_points’</p>

_imaging.c:2649: error: expected ‘}’ before ‘_draw_arc’</p>

_imaging.c:2650: error: expected ‘}’ before ‘_draw_bitmap’</p>

_imaging.c:2651: error: expected ‘}’ before ‘_draw_chord’</p>

_imaging.c:2652: error: expected ‘}’ before ‘_draw_ellipse’</p>

_imaging.c:2653: error: expected ‘}’ before ‘_draw_pieslice’</p>

_imaging.c:2654: error: expected ‘}’ before ‘_draw_ink’</p>

_imaging.c:2659: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2668: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c: In function ‘pixel_access_dealloc’:

_imaging.c:2693: error: ‘PixelAccessObject’ has no member named ‘image’</p>

_imaging.c: At top level:

_imaging.c:2697: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2708: error: expected declaration specifiers or ‘...’ before ‘PyObject’</p>

_imaging.c:2708: error: expected declaration specifiers or ‘...’ before ‘PyObject’</p>

_imaging.c: In function ‘pixel_access_setitem’:

_imaging.c:2710: error: ‘PixelAccessObject’ has no member named ‘image’</p>

_imaging.c:2714: error: ‘PixelAccessObject’ has no member named ‘readonly’</p>

_imaging.c:2719: warning: implicit declaration of function ‘_getxy’</p>

_imaging.c:2719: error: ‘xy’ undeclared (first use in this function)

_imaging.c:2723: error: ‘PyExc_IndexError’ undeclared (first use in this function)

_imaging.c:2727: error: ‘color’ undeclared (first use in this function)

_imaging.c:2730: warning: implicit declaration of function ‘getink’</p>

_imaging.c:2733: error: ‘PixelAccessObject’ has no member named ‘image’</p>

_imaging.c: At top level:

_imaging.c:2744: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2763: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2774: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2791: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2811: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2846: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:2867: error: array type has incomplete element type

_imaging.c:2870: error: expected ‘}’ before ‘_getpixel’</p>

_imaging.c:2871: error: expected ‘}’ before ‘_putpixel’</p>

_imaging.c:2873: error: expected ‘}’ before ‘pixel_access_new’</p>

_imaging.c:2876: error: expected ‘}’ before ‘_convert’</p>

_imaging.c:2877: error: expected ‘}’ before ‘_convert2’</p>

_imaging.c:2878: error: expected ‘}’ before ‘_convert_matrix’</p>

_imaging.c:2879: error: expected ‘}’ before ‘_copy’</p>

_imaging.c:2880: error: expected ‘}’ before ‘_copy2’</p>

_imaging.c:2884: error: expected ‘}’ before ‘_crop’</p>

_imaging.c:2885: error: expected ‘}’ before ‘_expand’</p>

_imaging.c:2886: error: expected ‘}’ before ‘_filter’</p>

_imaging.c:2887: error: expected ‘}’ before ‘_histogram’</p>

_imaging.c:2889: error: expected ‘}’ before ‘_modefilter’</p>

_imaging.c:2891: error: expected ‘}’ before ‘_offset’</p>

_imaging.c:2892: error: expected ‘}’ before ‘_paste’</p>

_imaging.c:2893: error: expected ‘}’ before ‘_point’</p>

_imaging.c:2894: error: expected ‘}’ before ‘_point_transform’</p>

_imaging.c:2895: error: expected ‘}’ before ‘_putdata’</p>

_imaging.c:2897: error: expected ‘}’ before ‘_quantize’</p>

_imaging.c:2900: error: expected ‘}’ before ‘_rankfilter’</p>

_imaging.c:2902: error: expected ‘}’ before ‘_resize’</p>

_imaging.c:2903: error: expected ‘}’ before ‘_rotate’</p>

_imaging.c:2904: error: expected ‘}’ before ‘_stretch’</p>

_imaging.c:2905: error: expected ‘}’ before ‘_transpose’</p>

_imaging.c:2906: error: expected ‘}’ before ‘_transform2’</p>

_imaging.c:2908: error: expected ‘}’ before ‘_isblock’</p>

_imaging.c:2910: error: expected ‘}’ before ‘_getbbox’</p>

_imaging.c:2911: error: expected ‘}’ before ‘_getcolors’</p>

_imaging.c:2912: error: expected ‘}’ before ‘_getextrema’</p>

_imaging.c:2913: error: expected ‘}’ before ‘_getprojection’</p>

_imaging.c:2915: error: expected ‘}’ before ‘_getband’</p>

_imaging.c:2916: error: expected ‘}’ before ‘_putband’</p>

_imaging.c:2917: error: expected ‘}’ before ‘_fillband’</p>

_imaging.c:2919: error: expected ‘}’ before ‘im_setmode’</p>

_imaging.c:2921: error: expected ‘}’ before ‘_getpalette’</p>

_imaging.c:2922: error: expected ‘}’ before ‘_putpalette’</p>

_imaging.c:2923: error: expected ‘}’ before ‘_putpalettealpha’</p>

_imaging.c:2927: error: expected ‘}’ before ‘_chop_invert’</p>

_imaging.c:2928: error: expected ‘}’ before ‘_chop_lighter’</p>

_imaging.c:2929: error: expected ‘}’ before ‘_chop_darker’</p>

_imaging.c:2930: error: expected ‘}’ before ‘_chop_difference’</p>

_imaging.c:2931: error: expected ‘}’ before ‘_chop_multiply’</p>

_imaging.c:2932: error: expected ‘}’ before ‘_chop_screen’</p>

_imaging.c:2933: error: expected ‘}’ before ‘_chop_add’</p>

_imaging.c:2934: error: expected ‘}’ before ‘_chop_subtract’</p>

_imaging.c:2935: error: expected ‘}’ before ‘_chop_add_modulo’</p>

_imaging.c:2936: error: expected ‘}’ before ‘_chop_subtract_modulo’</p>

_imaging.c:2937: error: expected ‘}’ before ‘_chop_and’</p>

_imaging.c:2938: error: expected ‘}’ before ‘_chop_or’</p>

_imaging.c:2939: error: expected ‘}’ before ‘_chop_xor’</p>

_imaging.c:2944: error: expected ‘}’ before ‘_gaussian_blur’</p>

_imaging.c:2945: error: expected ‘}’ before ‘_unsharp_mask’</p>

_imaging.c:2950: error: expected ‘}’ before ‘_effect_spread’</p>

_imaging.c:2954: error: expected ‘}’ before ‘_new_array’</p>

_imaging.c:2955: error: expected ‘}’ before ‘_new_block’</p>

_imaging.c:2958: error: expected ‘}’ before ‘_save_ppm’</p>

_imaging.c:2967: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c: In function ‘image_length’:

_imaging.c:2996: error: ‘ImagingObject’ has no member named ‘image’</p>

_imaging.c: At top level:

_imaging.c:3001: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3016: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘image_as_sequence’</p>

_imaging.c:3029: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘PyTypeObject’</p>

_imaging.c:3050: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘PyTypeObject’</p>

_imaging.c:3062: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘PyTypeObject’</p>

_imaging.c:3076: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘pixel_access_as_mapping’</p>

_imaging.c:3084: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘PyTypeObject’</p>

_imaging.c:3106: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3108: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3109: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3110: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3111: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3112: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3113: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3114: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3115: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3116: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3117: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3118: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3119: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3123: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3124: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3125: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3126: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3127: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3128: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3129: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3144: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3147: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3149: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3150: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘*’ token

_imaging.c:3152: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘functions’</p>

_imaging.c:3250: warning: return type defaults to ‘int’</p>

_imaging.c: In function ‘DL_EXPORT’:

_imaging.c:3250: error: expected declaration specifiers before ‘init_imaging’</p>

_imaging.c:3281: error: expected ‘{’ at end of input

error: command 'gcc' failed with exit status 1

4

4 に答える 4

2

これは、新しいマシンにインストールするときに使用するガイドです。

必要な依存関係:

  • libjpeg8
  • libjpeg8-dev
  • libfreetype6
  • libfreetype6-dev
  • zlib1g
  • zlib1g-dev

そして、シンボリックリンクを再確認してください

HTH

于 2013-01-06T09:03:48.370 に答える
2

PIL を仮想環境にインストールするには、まず、すべての依存関係がシステムで利用可能であることを確認する必要があります。

まず、ビルド環境がインストールされていることを確認します。を実行sudo apt-get install build-essentialしてから、次のコマンドを実行します。

sudo apt-get build-dep python-imaging

それが完了したら (時間がかかる場合があります)、sudo を使用せずに仮想環境をアクティブ化し、仮想環境内でsudo runを使用せずに aginを実行pip install PILします。

これをsudo pip install PIL行うと、仮想環境ではなく、システム全体の Python にインストールされました。

于 2013-01-06T08:35:58.207 に答える
2

Burhan Khalid さん、ご指摘ありがとうございます。

私がする必要があったのは

sudo apt-get install python2.7-dev.

これにより、Python.h が usr/include/python2.7 に追加され、gcc は PIL をコンパイルできるようになりました。

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

于 2013-01-06T10:01:53.720 に答える
2

Pillowで運が良くなるかもしれません。Pillow は、PIL の setuptools 非互換性に対処する PIL のフォークです。

于 2013-01-06T08:19:31.150 に答える