2012-03-04 10 views
6

は良いです:_imagingのCモジュールがインストールされていない

Exception Type: ImportError 
Exception Value:  
The _imaging C module is not installed 
Exception Location: D:\install\python27\lib\site-packages\PIL\Image.py in __getattr__, line 37 
Python Executable: D:\install\python27\python.exe 
Python Version: 2.7.1 
Python Path:  
['D:\\~Sasha\\Portman', 
'D:\\install\\python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg', 
'D:\\install\\python27\\lib\\site-packages\\pisa-3.0.33-py2.7.egg', 
'D:\\install\\python27\\lib\\site-packages\\html5lib-0.95-py2.7.egg', 
'D:\\install\\python27\\lib\\site-packages\\pypdf-1.13-py2.7.egg', 
'D:\\install\\PyCharm 2.0.2\\helpers', 
'D:\\~Sasha\\Portman', 
'D:\\~Sasha', 
'C:\\Windows\\system32\\python27.zip', 
'D:\\install\\python27\\DLLs', 
'D:\\install\\python27\\lib', 
'D:\\install\\python27\\lib\\plat-win', 
'D:\\install\\python27\\lib\\lib-tk', 
'D:\\install\\python27', 
'D:\\install\\python27\\lib\\site-packages', 
'D:\\install\\python27\\lib\\site-packages\\PIL'] 

PILはPILのウェブサイトからコンパイル済みのバンドルを介してインストールして_imagingはこの出力を与えていたインポートされた:

Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:02) [MSC v.1500 64 bit (AMD64)] on win32 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import _imaging 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: DLL load failed: %1 is not a valid Win32 application. 

は、この問題を引き起こしているのx64をPythonのだろうか?

Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:02) [MSC v.1500 64 bit (AMD64)] on win32 

私はPILのx64のために事前に構築されたパッケージを持って、既存のバンドルの上にそれをインストールし、今コンソール経由でインポートして作業を行います。

>>> import _imaging 
import _imaging # dynamically loaded from D:\install\python27\lib\site-packages\PIL\_imaging.pyd 

が、私はしようとしながら、同じエラーを取得しておきますpdfファイルを生成します。

答えて

13

はい、これは間違いなくx64の問題による可能性があります。 Python x64を実行している場合、ネイティブDLLを含むモジュールは、x64用にコンパイルされたバージョンにもインストールする必要があります。

編集:x64用の実際のプリコンパイル済みバージョンはPILサイトでは見つかりませんが、自分でコンパイルする場合はhereが出発点です。

+0

葉OK、インストールx64および参照:>>>動的Dからロードされた輸入_imaging 輸入_imaging番号:\インストール\ python27 \ libに\のsite-packages \ PIL \ _imaging.pydが、それでも同じエラー – abolotnov

+4

@abolotnovを取得ちょうど、http://www.lfd.uci.edu/~gohlke/pythonlibs/#pilのPILライブラリを使ってPython x64をテストしました。まず古いものをアンインストールしてください。 –

+0

サーバを再起動して、ちょっと待って!ありがとう! – abolotnov

0

私はWindows上にあり、 "ImportError:_imaging Cモジュールがインストールされていません"という問題がありました。

ここから枕をインストールすることによって解決される問題:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil。 (それはポストによって与えられますが、私はそれを見つけることはできません..)

2

私は同じ問題を抱えていました。私はただ単に

PIL

をアンインストールし、これが私のために働いPIL

pip install pillow

の代替であるPillowをインストールしました。

+0

ありがとうございます!!!!!また、これはPILをアンインストールせずに私のために働いた(私はそれをやろうとしたときにピップ警告を得たので私はしなかった) – doublefelix

関連する問題