如何在 Windows 7 上使用 pypy 安装 PIL?

5

我在一个Linux虚拟机上尝试了这个方法,结果非常成功。但是,在Windows 7上使用PyPy运行“pip install pil”时,会出现一些定义重复的警告:

~\Windows\v7.1\include\basetsd.h(76) : warning C4114: same type qualifier used more than once

通过在安装好的PIL源代码中编辑#undef INT8/16/32 UINT8/16/32可以解决这个问题,但最终可能会遇到以下错误:

LINK : fatal error LNK1181: cannot open input file 'python27.lib' error: command 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe' failed with exit status 1181

这个方法对于Windows7上的CPython和Linux上的PyPy都可以直接使用。但是,有没有人知道如何让它在Windows上的PyPy上运行呢?

1个回答

3
这对我很有帮助:
1)根据http://adrianhenke.wordpress.com/2008/12/05/create-lib-file-from-dll/PyPy\libpypy-c.dll创建一个libpypy-c.lib
2)将PyPy\lib-python\modified-2.7\distutils\command\build_ext.py的第710行更改为return ext.libraries + ['libpypy-c']
3)将libpypy-c.lib的路径添加到LIB环境变量中,并重新构建PIL。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接