PythonPIL在window64位机制上引用异常问题解决

Posted inns

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PythonPIL在window64位机制上引用异常问题解决相关的知识,希望对你有一定的参考价值。

转自http://stackoverflow.com/questions/3652625/installing-setuptools-on-64-bit-windows

 

问题

 

I‘m running Python 2.7 on Windows 7 64-bit, and when I run the installer for setuptools it tells me that Python 2.7 is not installed. The specific error message is:

`Python Version 2.7 required which was not found in the registry`

My installed version of Python is:

`Python 2.7 (r27:82525, Jul  4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32`

I‘m looking at the setuptools site and it doesn‘t mention any installers for 64-bit Windows. Have I missed something or do I have to install this from source?

 

 

解答

 

Apparently (having faced related 64- and 32-bit issues on OS X) there is a bug in the Windows installer. I stumbled across this workaround, which might help - basically, you create your own registry value HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.6\InstallPath and copy over the InstallPath value from HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\InstallPath. See the answer below for more details.

If you do this, beware that setuptools may only install 32-bit libraries.

NOTE: the responses below offer more detail, so please read them too.

 

 

PIL使用该方法仍然报错

 

ImportError: The _imaging C module is not installed

 

最后找到一个64为的PIL,安装之后OK

http://www.qttc.net/static/file/PIL-fork-1.1.7.win-amd64-py2.7.exe

以上是关于PythonPIL在window64位机制上引用异常问题解决的主要内容,如果未能解决你的问题,请参考以下文章

Visual Studio 在 Windows 7 64 位机器上找不到 CIODMLib 项目参考

将 32 位 COM DLL 注册到 64 位 Windows 7

C# 32位程序在64位系统下注册表操作

在 64 位 Windows 上安装 32 位或 64 位应用程序有啥区别?

在 64 位 Windows 上 long 的位大小是多少?

在 64 位 Windows 7 和 64 位 Python 2.7 上安装 Pygame