2013-05-15 3 views
1

pip와 mingw를 사용하여 PIL을 설치하려고합니다. 그러나 다음과 같이 실패합니다.PIL을 windows에 pip + mingw와 함께 설치하는 방법은 무엇입니까?

Downloading/unpacking PIL 
    Running setup.py egg_info for package PIL 
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py 

Installing collected packages: PIL 
    Running setup.py install for PIL 
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py 
    building '_imaging' extension 
    C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c _imaging.c -o build\temp.win32-2.7\Release\_imaging.o 
    _imaging.c: In function 'init_imaging': 
    _imaging.c:3253:15: warning: variable 'd' set but not used [-Wunused-but-set-variable] 
    C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c decode.c -o build\temp.win32-2.7\Release\decode.o 
    C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c encode.c -o build\temp.win32-2.7\Release\encode.o 
    C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c map.c -o build\temp.win32-2.7\Release\map.o 
    In file included from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/winnt.h:192:0, 
        from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/windef.h:253, 
        from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/windows.h:48, 
        from map.c:35: 
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:50:21: error: duplicate 'signed' 
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:50:21: error: two or more data types in declaration specifiers 
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:51:22: error: duplicate 'short' 
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:56:23: error: duplicate 'unsigned' 
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:56:23: error: two or more data types in declaration specifiers 
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:57:24: error: duplicate 'unsigned' 
    c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:57:24: error: duplicate 'short' 
    error: command 'gcc' failed with exit status 1 
    Complete output from command C:\Python27\python.exe -c "import setuptools;__file__='c:\\users\\marshall\\appdata\\local\\temp\\pip-build-marshall\\PIL\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\marshall\appdata\local\temp\pip-pnnyve-record\install-record.txt --single-version-externally-managed: 
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py 

running install 

running build 

running build_py 

running build_ext 

building '_imaging' extension 

C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c _imaging.c -o build\temp.win32-2.7\Release\_imaging.o 

_imaging.c: In function 'init_imaging': 

_imaging.c:3253:15: warning: variable 'd' set but not used [-Wunused-but-set-variable] 

C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c decode.c -o build\temp.win32-2.7\Release\decode.o 

C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c encode.c -o build\temp.win32-2.7\Release\encode.o 

C:\MinGW\bin\gcc.exe -mdll -O -Wall -IlibImaging -IC:\Python27\include -IC:\Python27\include -IC:\Python27\PC -c map.c -o build\temp.win32-2.7\Release\map.o 

In file included from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/winnt.h:192:0, 

       from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/windef.h:253, 

       from c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/windows.h:48, 

       from map.c:35: 

c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:50:21: error: duplicate 'signed' 

c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:50:21: error: two or more data types in declaration specifiers 

c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:51:22: error: duplicate 'short' 

c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:56:23: error: duplicate 'unsigned' 

c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:56:23: error: two or more data types in declaration specifiers 

c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:57:24: error: duplicate 'unsigned' 

c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include/basetsd.h:57:24: error: duplicate 'short' 

error: command 'gcc' failed with exit status 1 

---------------------------------------- 
Command C:\Python27\python.exe -c "import setuptools;__file__='c:\\users\\marshall\\appdata\\local\\temp\\pip-build-marshall\\PIL\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\marshall\appdata\local\temp\pip-pnnyve-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\marshall\appdata\local\temp\pip-build-marshall\PIL 
Storing complete log in C:\Users\marshall\pip\pip.log 

나는이 문제를 해결할 수있는 방법?

답변

0

사전 제작 된 설치 프로그램을 사용하는 것이 좋습니다. PIL Unofficial Windows Binary을 참조하십시오. (동일한 링크의 설치 프로그램으로도 사용 가능) Pillow을 강력히 추천합니다.

+0

베개는 실제로 핍을 사용하여 잘 설치합니다. 감사합니다. 그러나 당신이 정말로 pip를 사용하여 Windows에 기본 패키지를 설치할 수 없다면 그것은 부끄러운 것처럼 보입니다. – marshall

+0

@marshall 패키지에 컴파일러가 필요하면 대부분 문제가되지만 그래, 항상 편리하지는 않다. –

1

INT8, INT16은 UINT8, UINT16이 정의 INT PIL 소스

당신이 C에서 #ifndef..#endif을 추가 할 수 있습니다 : \와 Mingw \ basetsd.h \ 포함 : 모든 유형에 대한

+#ifndef INT8 
typedef signed char INT8; 
+#endif 

. (여기서 '+'는 줄 바꿈을 의미 함)

작동합니다.

관련 문제