我一直在努力使用 easy_install 在我的 Windows (XP) 安装上为 PyPy (2.1) 构建 Pillow。问题似乎与它缺少所需的 python/pypy 标头(?)有关。我已经在谷歌上下搜索了好几天,希望能找到一些可以详细说明我遇到的问题的人,但没有找到任何有用的东西。
我得到的错误日志是:
...
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -IlibImaging -IC:\pypy-21\include -IC:\pypy-21\include /Tc
libImaging\UnsharpMask.c /Fobuild\temp.win32-2.7\Release\libImaging\UnsharpMask.obj
...
decode.obj : error LNK2001: unresolved external symbol __imp__PyType_Type
encode.obj : error LNK2001: unresolved external symbol __imp__PyType_Type
map.obj : error LNK2001: unresolved external symbol __imp__PyType_Type
encode.obj : error LNK2019: unresolved external symbol __imp___PyString_Resize r
eferenced in function __encode
encode.obj : error LNK2019: unresolved external symbol __imp__PyErr_SetFromErrno
referenced in function __encode_to_file
encode.obj : error LNK2019: unresolved external symbol __imp__PyExc_SystemError
referenced in function __setimage
display.obj : error LNK2019: unresolved external symbol __imp__PyList_Append ref
erenced in function _list_windows_callback@8
display.obj : error LNK2019: unresolved external symbol __imp__PyErr_Print refer
enced in function _callback_error
display.obj : error LNK2019: unresolved external symbol __imp__PyFile_WriteStrin
g referenced in function _callback_error
display.obj : error LNK2019: unresolved external symbol __imp__PySys_GetObject r
eferenced in function _callback_error
display.obj : error LNK2019: unresolved external symbol _PyObject_CallFunction r
eferenced in function _windowCallback@16
path.obj : error LNK2001: unresolved external symbol _PyObject_CallFunction
display.obj : error LNK2019: unresolved external symbol __imp__PyThreadState_Swa
p referenced in function _windowCallback@16
display.obj : error LNK2019: unresolved external symbol __imp__PyThreadState_Get
referenced in function _PyImaging_CreateWindowWin32
path.obj : error LNK2019: unresolved external symbol __imp__PyErr_ExceptionMatch
es referenced in function _PyPath_Flatten
path.obj : error LNK2019: unresolved external symbol __imp__PyNumber_Check refer
enced in function _PyPath_Flatten
path.obj : error LNK2019: unresolved external symbol __imp__PyExc_RuntimeError r
eferenced in function _path_clip_polygon
build\lib.win32-2.7\_imaging.pypy-21.pyd : fatal error LNK1120: 61 unresolved ex
ternals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.e
xe' failed with exit status 1120
我真的很难明白为什么会这样,我实际上不知道。我可以轻松地为 CPython 构建包。
据我所知,还包括依赖项文件夹:“-IC:\pypy-21\include”(?)。
有关更多日志,您可以查看http://pastebin.com/raw.php?i=kKnNpRgr
编辑 - 解决方案
在获取 PyPy 2.2.1 之后,我发现我的“PyPy-21/Include”路径中确实缺少一些文件。所以.. Pillow 与新发现的标头一起安装得很好,并且运行完美!=)