I'm trying to install said library for use with Python. I tried downloading the executable installer for Windows, which runs, but says it doesn't find a Python installation. Then tried registering (http://effbot.org/zone/python-register.htm) Python, but the script says it can't register (although the keys appear in my register).
我正在尝试安装使用Python的库。我试着下载运行Windows的可执行安装程序,但说它没有找到Python安装。然后尝试注册(http://effbot.org/zone/pythonregister.htm) Python,但是脚本说它不能注册(尽管键出现在我的寄存器中)。
Then I tried downloading the source package: I run the setup.py build and it works, but when I run setup.py install it says the following:
然后我尝试下载源代码包:我运行安装程序。py构建和它可以工作,但是当我运行设置时。py安装说明如下:
running install
running build
running build_py
running build_ext
building '_imaging' extension
error: Unable to find vcvarsall.bat
What can I do?
我能做什么?
UPDATE (May 2014): Like said by some comments and answers, PIL is currently unmantained, and the way to go now is to use Pillow (https://pypi.python.org/pypi/Pillow/, pip install pillow
).
更新(2014年5月):就像一些评论和回答说的那样,PIL现在是不确定的,现在的方法是使用枕头(https://pypi.python.org/pypi/Pillow/, pip安装枕头)。
10 个解决方案
#1
19
Compiling PIL on Windows x64 is apparently a bit of a pain. (Well, compiling anything on Windows is a bit of a pain in my experience. But still.) As well as PIL itself you'll need to build many dependencies. See these notes from the mailing list too.
在Windows x64上编译PIL,显然有点痛苦。(嗯,在Windows上编译任何东西都是我经历中的一点痛苦。但仍然)。除了PIL本身,您还需要构建许多依赖项。从邮件列表中也可以看到这些注释。
There's an unofficial precompiled binary for x64 linked from this message, but I haven't tried it myself. Might be worth a go if you don't mind the download being from one of those slightly dodgy file-upload sites. Other than that... well, you could always give up and instead the 32-bit Python binary instead.
x64有一个非官方的预编译二进制文件,但我自己没有尝试过。如果你不介意从那些有点不可靠的文件上传网站下载的话,也许值得一试。除此之外……你可以放弃32位的Python二进制代码。
#2
117
I found a working win7 binary here: Unofficial Windows Binaries for Python Extension Packages It's from Christoph Gohlke at UC Irvine. There are binaries for python 2.5, 2.6, 2.7 , 3.1 and 3.2 for both 32bit and 64 bit windows.
我在这里找到了一个工作win7二进制文件:用于Python扩展包的非官方Windows二进制文件,它来自UC Irvine的Christoph Gohlke。对于32位和64位windows, python 2.5、2.6、2.7、3.1和3.2都有二进制文件。
There are a whole lot of other compiled packages here, too.
这里还有很多其他的编译包。
Be sure to uninstall your old PILfirst. If you used easy_install: easy_install -mnX pil
And then remove the egg in python/Lib/site-packages
一定要把你的旧皮包拆下来。如果您使用easy_install: easy_install -mnX pil,然后在python/Lib/站点包中删除egg。
Be sure to remove any other failed attempts. I had moved the _image dll into Python*.*/DLLs and I had to remove it.
确保删除任何其他失败的尝试。我将_image dll移到Python*中。*/ dll,我必须删除它。
#3
29
I've just had the same problem (with Python 2.7 and PIL for this versions, but the solution should work also for 2.6) and the way to solve it is to copy all the registry keys from:
我刚刚遇到了同样的问题(针对这个版本的Python 2.7和PIL,但是解决方案应该也适用于2.6),解决它的方法是复制所有的注册表键:
HKEY_LOCAL_MACHINE\SOFTWARE\Python
to
来
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python
Worked for me
为我工作
solution found at the address below so credits should go there: http://effbot.slinkset.com/items/Adding_Python_Information_to_the_Windows_Registry
在下面地址找到的解决方案应该是:http://effbot.slinkset.com/items/Adding_Python_Information_to_the_Windows_Registry。
#4
3
If you installed a win64 python, you need a win64 PIL. The official PIL download site only has win32, as far as I can tell. The win32 installer will not see your 64-bit python installation.
如果您安装了win64 python,您需要一个win64 PIL。据我所知,官方的PIL下载网站只有win32。win32安装程序不会看到您的64位python安装。
No amount of tinkering with permissions or redistributables will fix this. You could use the win32 python instead (the Win64 python is mutant anyhow; Microsoft decided that C 'long' should be 32 bits in their 64-bit world, so python 'ints' are only 32 bits in Win64 python).
再多的修改权限或重新分配都不会解决这个问题。您可以使用win32 python来代替(无论如何,Win64 python是变种;微软认为C 'long'应该是64位世界中的32位,所以python 'ints'在Win64 python中只有32位。
Since sizeof(long)!=sizeof(ptr) in win64, porting C extensions can be problematic, and will not be the same as porting them to linux 64. E.g. it seems that Win64 numpy is experimental/broken whereas linux64 numpy has been fine for years. My recommendation is if you use win64, stick with win32 python. If you want 64-bit python use linux.
由于win64中的sizeof(long)!=sizeof(ptr),移植C扩展可能会有问题,而且与将它们移植到linux 64上不一样。看起来Win64 numpy是实验性的/破碎的,而linux64 numpy已经好多年了。我的建议是,如果您使用win64,则使用win32 python。如果您想要64位的python使用linux。
#5
1
I think I had a similar problem in the past, with another python library. I believe that it was a windows permission issue. Try adding "Users" to your python directory, and give them full access.
我想我以前遇到过类似的问题,还有一个python库。我认为这是一个windows权限问题。尝试将“用户”添加到您的python目录中,并给它们充分的访问权限。
#6
0
Make sure you have the Visual C++ Redistributable package installed on your machine.
确保您的机器上安装了Visual c++可再分发包。
#7
0
Just got this error msg on my 32 bit Windows - I read the FAQ here: http://pythonware.com/products/pil/faq.htm and this sort of indicates that Windows is funny. Looked again at install pg and downloaded the Windows executable for Python26 # Python Imaging Library 1.1.7 for Python 2.6 (Windows only) - and the _imaging module gets installed when you run this. Should solve problem. So you can't just do the python setup.py install routine on: Python Imaging Library 1.1.7 Source Kit (all platforms) (November 15, 2009).
我在32位窗口中找到了这个错误msg——我在这里阅读了FAQ: http://pythonware.com/products/pil/faq.htm,这表明Windows很有趣。再次查看安装pg,并下载Python 2.6的Python映像库1.1.7版本的Windows可执行文件(仅为Windows),并且在运行此过程时将安装_imaging模块。应该解决的问题。所以你不能只做python设置。py安装程序:Python映像库1.1.7源代码包(所有平台)(2009年11月15日)。
#8
0
I was having the same problem so I decided to download the source kit and install it according to how you posted above...
我也遇到了同样的问题,所以我决定下载源码工具包并根据你在上面发布的方式安装它……
- Downloaded Source Kit
- 下载源设备
- Opened command prompt on that folder and typed python setup.py build
- 打开该文件夹和类型化python设置的命令提示符。py构建
- Then I typed python setup.py install
- 然后输入python设置。py安装
It worked perfectly!
做得很成功!
Now, some notes: when I typed python setup.py build
, I saw that Microsoft Visual Studio v9.0 C compiler was being used to build everything.
现在,一些注释:当我键入python设置时。py构建,我看到Microsoft Visual Studio v9.0 C编译器被用来构建所有东西。
So probably it's something with your compiler not correctly configured or something...
所以可能是你的编译器没有正确配置或者什么…
Anyways, that worked with me so thank you!
不管怎样,这对我很有用,谢谢你!
#9
0
Pillow is new version
枕头是新版本
PIL-1.1.7.win-amd64-py2.x installers are available at
PIL-1.1.7.win-amd64-py2。x安装程序可用。
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
http://www.lfd.uci.edu/ gohlke pythonlibs / #公益诉讼
#10
0
http://www.lfd.uci.edu/~gohlke/pythonlibs/
http://www.lfd.uci.edu/ gohlke / pythonlibs /
press contrl F type Pillow‑2.4.0.win‑amd64‑py3.3.exe
压紧式枕头- 2.4.0.win - amd64 - py3.3.exe。
then click and downloadd the 64 bit version
然后单击并向下添加64位版本。
Pillow is a replacement for PIL, the Python Image Library, which provides image processing functionality and supports many file formats. Note: use from PIL import Image
instead of import Image
. PIL‑1.1.7.win‑amd64‑py2.5.exe PIL‑1.1.7.win32‑py2.5.exe Pillow‑2.4.0.win‑amd64‑py2.6.exe Pillow‑2.4.0.win‑amd64‑py2.7.exe Pillow‑2.4.0.win‑amd64‑py3.2.exe Pillow‑2.4.0.win‑amd64‑py3.3.exe Pillow‑2.4.0.win‑amd64‑py3.4.exe Pillow‑2.4.0.win32‑py2.6.exe Pillow‑2.4.0.win32‑py2.7.exe Pillow‑2.4.0.win32‑py3.2.exe Pillow‑2.4.0.win32‑py3.3.exe Pillow‑2.4.0.win32‑py3.4.exe
枕头是Python图像库PIL的替代品,它提供图像处理功能,支持多种文件格式。注意:使用PIL导入图像而不是导入图像。公益诉讼- 1.1.7.win amd64——py2.5。exe公益诉讼从1.1.7.win32 py2.5。exe枕头- 2.4.0.win amd64——py2.6。exe枕头- 2.4.0.win amd64——py2.7。exe枕头- 2.4.0.win amd64——py3.2。exe枕头- 2.4.0.win amd64——py3.3。exe枕头- 2.4.0.win amd64——py3.4。exe枕头从2.4.0.win32 py2.6。exe枕头从2.4.0.win32 py2.7。exe枕头从2.4.0.win32 py3.2。exe枕头从2.4.0.win32 py3.3。exe枕头从2.4.0.win32 py3.4.exe
#1
19
Compiling PIL on Windows x64 is apparently a bit of a pain. (Well, compiling anything on Windows is a bit of a pain in my experience. But still.) As well as PIL itself you'll need to build many dependencies. See these notes from the mailing list too.
在Windows x64上编译PIL,显然有点痛苦。(嗯,在Windows上编译任何东西都是我经历中的一点痛苦。但仍然)。除了PIL本身,您还需要构建许多依赖项。从邮件列表中也可以看到这些注释。
There's an unofficial precompiled binary for x64 linked from this message, but I haven't tried it myself. Might be worth a go if you don't mind the download being from one of those slightly dodgy file-upload sites. Other than that... well, you could always give up and instead the 32-bit Python binary instead.
x64有一个非官方的预编译二进制文件,但我自己没有尝试过。如果你不介意从那些有点不可靠的文件上传网站下载的话,也许值得一试。除此之外……你可以放弃32位的Python二进制代码。
#2
117
I found a working win7 binary here: Unofficial Windows Binaries for Python Extension Packages It's from Christoph Gohlke at UC Irvine. There are binaries for python 2.5, 2.6, 2.7 , 3.1 and 3.2 for both 32bit and 64 bit windows.
我在这里找到了一个工作win7二进制文件:用于Python扩展包的非官方Windows二进制文件,它来自UC Irvine的Christoph Gohlke。对于32位和64位windows, python 2.5、2.6、2.7、3.1和3.2都有二进制文件。
There are a whole lot of other compiled packages here, too.
这里还有很多其他的编译包。
Be sure to uninstall your old PILfirst. If you used easy_install: easy_install -mnX pil
And then remove the egg in python/Lib/site-packages
一定要把你的旧皮包拆下来。如果您使用easy_install: easy_install -mnX pil,然后在python/Lib/站点包中删除egg。
Be sure to remove any other failed attempts. I had moved the _image dll into Python*.*/DLLs and I had to remove it.
确保删除任何其他失败的尝试。我将_image dll移到Python*中。*/ dll,我必须删除它。
#3
29
I've just had the same problem (with Python 2.7 and PIL for this versions, but the solution should work also for 2.6) and the way to solve it is to copy all the registry keys from:
我刚刚遇到了同样的问题(针对这个版本的Python 2.7和PIL,但是解决方案应该也适用于2.6),解决它的方法是复制所有的注册表键:
HKEY_LOCAL_MACHINE\SOFTWARE\Python
to
来
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python
Worked for me
为我工作
solution found at the address below so credits should go there: http://effbot.slinkset.com/items/Adding_Python_Information_to_the_Windows_Registry
在下面地址找到的解决方案应该是:http://effbot.slinkset.com/items/Adding_Python_Information_to_the_Windows_Registry。
#4
3
If you installed a win64 python, you need a win64 PIL. The official PIL download site only has win32, as far as I can tell. The win32 installer will not see your 64-bit python installation.
如果您安装了win64 python,您需要一个win64 PIL。据我所知,官方的PIL下载网站只有win32。win32安装程序不会看到您的64位python安装。
No amount of tinkering with permissions or redistributables will fix this. You could use the win32 python instead (the Win64 python is mutant anyhow; Microsoft decided that C 'long' should be 32 bits in their 64-bit world, so python 'ints' are only 32 bits in Win64 python).
再多的修改权限或重新分配都不会解决这个问题。您可以使用win32 python来代替(无论如何,Win64 python是变种;微软认为C 'long'应该是64位世界中的32位,所以python 'ints'在Win64 python中只有32位。
Since sizeof(long)!=sizeof(ptr) in win64, porting C extensions can be problematic, and will not be the same as porting them to linux 64. E.g. it seems that Win64 numpy is experimental/broken whereas linux64 numpy has been fine for years. My recommendation is if you use win64, stick with win32 python. If you want 64-bit python use linux.
由于win64中的sizeof(long)!=sizeof(ptr),移植C扩展可能会有问题,而且与将它们移植到linux 64上不一样。看起来Win64 numpy是实验性的/破碎的,而linux64 numpy已经好多年了。我的建议是,如果您使用win64,则使用win32 python。如果您想要64位的python使用linux。
#5
1
I think I had a similar problem in the past, with another python library. I believe that it was a windows permission issue. Try adding "Users" to your python directory, and give them full access.
我想我以前遇到过类似的问题,还有一个python库。我认为这是一个windows权限问题。尝试将“用户”添加到您的python目录中,并给它们充分的访问权限。
#6
0
Make sure you have the Visual C++ Redistributable package installed on your machine.
确保您的机器上安装了Visual c++可再分发包。
#7
0
Just got this error msg on my 32 bit Windows - I read the FAQ here: http://pythonware.com/products/pil/faq.htm and this sort of indicates that Windows is funny. Looked again at install pg and downloaded the Windows executable for Python26 # Python Imaging Library 1.1.7 for Python 2.6 (Windows only) - and the _imaging module gets installed when you run this. Should solve problem. So you can't just do the python setup.py install routine on: Python Imaging Library 1.1.7 Source Kit (all platforms) (November 15, 2009).
我在32位窗口中找到了这个错误msg——我在这里阅读了FAQ: http://pythonware.com/products/pil/faq.htm,这表明Windows很有趣。再次查看安装pg,并下载Python 2.6的Python映像库1.1.7版本的Windows可执行文件(仅为Windows),并且在运行此过程时将安装_imaging模块。应该解决的问题。所以你不能只做python设置。py安装程序:Python映像库1.1.7源代码包(所有平台)(2009年11月15日)。
#8
0
I was having the same problem so I decided to download the source kit and install it according to how you posted above...
我也遇到了同样的问题,所以我决定下载源码工具包并根据你在上面发布的方式安装它……
- Downloaded Source Kit
- 下载源设备
- Opened command prompt on that folder and typed python setup.py build
- 打开该文件夹和类型化python设置的命令提示符。py构建
- Then I typed python setup.py install
- 然后输入python设置。py安装
It worked perfectly!
做得很成功!
Now, some notes: when I typed python setup.py build
, I saw that Microsoft Visual Studio v9.0 C compiler was being used to build everything.
现在,一些注释:当我键入python设置时。py构建,我看到Microsoft Visual Studio v9.0 C编译器被用来构建所有东西。
So probably it's something with your compiler not correctly configured or something...
所以可能是你的编译器没有正确配置或者什么…
Anyways, that worked with me so thank you!
不管怎样,这对我很有用,谢谢你!
#9
0
Pillow is new version
枕头是新版本
PIL-1.1.7.win-amd64-py2.x installers are available at
PIL-1.1.7.win-amd64-py2。x安装程序可用。
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
http://www.lfd.uci.edu/ gohlke pythonlibs / #公益诉讼
#10
0
http://www.lfd.uci.edu/~gohlke/pythonlibs/
http://www.lfd.uci.edu/ gohlke / pythonlibs /
press contrl F type Pillow‑2.4.0.win‑amd64‑py3.3.exe
压紧式枕头- 2.4.0.win - amd64 - py3.3.exe。
then click and downloadd the 64 bit version
然后单击并向下添加64位版本。
Pillow is a replacement for PIL, the Python Image Library, which provides image processing functionality and supports many file formats. Note: use from PIL import Image
instead of import Image
. PIL‑1.1.7.win‑amd64‑py2.5.exe PIL‑1.1.7.win32‑py2.5.exe Pillow‑2.4.0.win‑amd64‑py2.6.exe Pillow‑2.4.0.win‑amd64‑py2.7.exe Pillow‑2.4.0.win‑amd64‑py3.2.exe Pillow‑2.4.0.win‑amd64‑py3.3.exe Pillow‑2.4.0.win‑amd64‑py3.4.exe Pillow‑2.4.0.win32‑py2.6.exe Pillow‑2.4.0.win32‑py2.7.exe Pillow‑2.4.0.win32‑py3.2.exe Pillow‑2.4.0.win32‑py3.3.exe Pillow‑2.4.0.win32‑py3.4.exe
枕头是Python图像库PIL的替代品,它提供图像处理功能,支持多种文件格式。注意:使用PIL导入图像而不是导入图像。公益诉讼- 1.1.7.win amd64——py2.5。exe公益诉讼从1.1.7.win32 py2.5。exe枕头- 2.4.0.win amd64——py2.6。exe枕头- 2.4.0.win amd64——py2.7。exe枕头- 2.4.0.win amd64——py3.2。exe枕头- 2.4.0.win amd64——py3.3。exe枕头- 2.4.0.win amd64——py3.4。exe枕头从2.4.0.win32 py2.6。exe枕头从2.4.0.win32 py2.7。exe枕头从2.4.0.win32 py3.2。exe枕头从2.4.0.win32 py3.3。exe枕头从2.4.0.win32 py3.4.exe