无法在Windows Vista中的virtualenv中使用pip安装PIL

时间:2012-04-25 12:19:01

标签: python windows python-imaging-library virtualenv pip

我创建了一个名为renamover的新virtualenv,然后尝试使用pil安装pip,但我相信安装因为在{{{}期间创建的Build目录而卡住了1}}安装永远不会被删除。以下显示位于pip virtualenv中的build\pil目录:

renamover

以下是安装过程中出现的错误/警告:

(renamover) C:\Users\s3z\Desktop\My Dropbox\pythons\renamover>dir build\pil
 Volume in drive C is SQ004814V03
 Volume Serial Number is A045-86B5

 Directory of C:\Users\s3z\Desktop\My Dropbox\pythons\renamover\build\pil

04/25/2012  01:58 PM    <DIR>          .
04/25/2012  01:58 PM    <DIR>          ..
04/25/2012  01:58 PM    <DIR>          build
04/25/2012  01:58 PM               239 BUILDME
04/25/2012  01:58 PM            63,751 CHANGES
04/25/2012  01:58 PM             8,940 CONTENTS
04/25/2012  01:58 PM            16,520 decode.c
04/25/2012  01:58 PM            20,783 display.c
04/25/2012  01:58 PM    <DIR>          Docs
04/25/2012  01:58 PM            35,988 doctest.py
04/25/2012  01:58 PM            13,230 encode.c
04/25/2012  01:58 PM    <DIR>          Images
04/25/2012  01:58 PM    <DIR>          libImaging
04/25/2012  01:58 PM             6,688 MANIFEST
04/25/2012  01:58 PM             8,953 map.c
04/25/2012  01:58 PM             3,869 outline.c
04/25/2012  01:58 PM            14,282 path.c
04/25/2012  01:58 PM    <DIR>          PIL
04/25/2012  01:58 PM                 4 PIL.pth
04/25/2012  01:58 PM    <DIR>          pip-egg-info
04/25/2012  01:58 PM               780 PKG-INFO
04/25/2012  01:58 PM            10,642 README
04/25/2012  01:58 PM    <DIR>          Sane
04/25/2012  01:58 PM    <DIR>          Scripts
04/25/2012  01:58 PM             5,632 selftest.py
04/25/2012  01:58 PM            17,323 setup.py
04/25/2012  01:58 PM    <DIR>          Tk
04/25/2012  01:58 PM            84,558 _imaging.c
04/25/2012  01:58 PM            16,792 _imagingcms.c
04/25/2012  01:58 PM            13,843 _imagingft.c
04/25/2012  01:58 PM             6,720 _imagingmath.c
04/25/2012  01:58 PM             1,456 _imagingtk.c
              21 File(s)        350,993 bytes
              11 Dir(s)   3,643,211,776 bytes free

此外,当我在C:\Users\s3z\Desktop\My Dropbox\pythons>virtualenv --distribute renamover New python executable in renamover\Scripts\python.exe Installing distribute................................................. ...................................................................... ...................................................................... ..done. Installing pip.................done. C:\Users\s3z\Desktop\My Dropbox\pythons>cd renamover C:\Users\s3z\Desktop\My Dropbox\pythons\renamover>pip install pil 'pip' is not recognized as an internal or external command, operable program or batch file. C:\Users\s3z\Desktop\My Dropbox\pythons\renamover>Scripts\activate (renamover) C:\Users\s3z\Desktop\My Dropbox\pythons\renamover>pip install pil Downloading/unpacking pil Downloading PIL-1.1.7.tar.gz (506Kb): 506Kb downloaded Running setup.py egg_info for package pil WARNING: '' not a valid package name; please use only.-separated p ackage names in setup.py Installing collected packages: pil Running setup.py install for pil WARNING: '' not a valid package name; please use only.-separated p ackage names in setup.py building '_imaging' extension error: Unable to find vcvarsall.bat Complete output from command "C:\Users\s3z\Desktop\My Dropbox\ pythons\renamover\Scripts\python.exe" -c "import setuptools;__file__=' C:\\Users\\s3z\\Desktop\\My Dropbox\\pythons\\renamover\\build\\pi l\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --rec ord c:\users\s3z\appdata\local\temp\pip-hyfdad-record\install-reco rd.txt --install-headers "C:\Users\s3z\Desktop\My Dropbox\pythons\ renamover\include\site\python2.7": WARNING: '' not a valid package name; please use only.-separated p ackage names in setup.py running install running build running build_py creating build creating build\lib.win-amd64-2.7 copying PIL\ArgImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\BdfFontFile.py -> build\lib.win-amd64-2.7 copying PIL\BmpImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\ContainerIO.py -> build\lib.win-amd64-2.7 copying PIL\CurImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\DcxImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\EpsImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\ExifTags.py -> build\lib.win-amd64-2.7 copying PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\FliImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\FontFile.py -> build\lib.win-amd64-2.7 copying PIL\FpxImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\GbrImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\GdImageFile.py -> build\lib.win-amd64-2.7 copying PIL\GifImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\GimpGradientFile.py -> build\lib.win-amd64-2.7 copying PIL\GimpPaletteFile.py -> build\lib.win-amd64-2.7 copying PIL\GribStubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\IcnsImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\IcoImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\Image.py -> build\lib.win-amd64-2.7 copying PIL\ImageChops.py -> build\lib.win-amd64-2.7 copying PIL\ImageCms.py -> build\lib.win-amd64-2.7 copying PIL\ImageColor.py -> build\lib.win-amd64-2.7 copying PIL\ImageDraw.py -> build\lib.win-amd64-2.7 copying PIL\ImageDraw2.py -> build\lib.win-amd64-2.7 copying PIL\ImageEnhance.py -> build\lib.win-amd64-2.7 copying PIL\ImageFile.py -> build\lib.win-amd64-2.7 copying PIL\ImageFileIO.py -> build\lib.win-amd64-2.7 copying PIL\ImageFilter.py -> build\lib.win-amd64-2.7 copying PIL\ImageFont.py -> build\lib.win-amd64-2.7 copying PIL\ImageGL.py -> build\lib.win-amd64-2.7 copying PIL\ImageGrab.py -> build\lib.win-amd64-2.7 copying PIL\ImageMath.py -> build\lib.win-amd64-2.7 copying PIL\ImageMode.py -> build\lib.win-amd64-2.7 copying PIL\ImageOps.py -> build\lib.win-amd64-2.7 copying PIL\ImagePalette.py -> build\lib.win-amd64-2.7 copying PIL\ImagePath.py -> build\lib.win-amd64-2.7 copying PIL\ImageQt.py -> build\lib.win-amd64-2.7 copying PIL\ImageSequence.py -> build\lib.win-amd64-2.7 copying PIL\ImageShow.py -> build\lib.win-amd64-2.7 copying PIL\ImageStat.py -> build\lib.win-amd64-2.7 copying PIL\ImageTk.py -> build\lib.win-amd64-2.7 copying PIL\ImageTransform.py -> build\lib.win-amd64-2.7 copying PIL\ImageWin.py -> build\lib.win-amd64-2.7 copying PIL\ImImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\ImtImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\IptcImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\JpegImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\McIdasImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\MicImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\MpegImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\MspImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\OleFileIO.py -> build\lib.win-amd64-2.7 copying PIL\PaletteFile.py -> build\lib.win-amd64-2.7 copying PIL\PalmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PcdImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PcfFontFile.py -> build\lib.win-amd64-2.7 copying PIL\PcxImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PdfImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PixarImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PngImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PpmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PsdImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PSDraw.py -> build\lib.win-amd64-2.7 copying PIL\SgiImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\SpiderImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\SunImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\TarIO.py -> build\lib.win-amd64-2.7 copying PIL\TgaImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\TiffImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\TiffTags.py -> build\lib.win-amd64-2.7 copying PIL\WalImageFile.py -> build\lib.win-amd64-2.7 copying PIL\WmfImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\XbmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\XpmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\__init__.py -> build\lib.win-amd64-2.7 running build_ext building '_imaging' extension error: Unable to find vcvarsall.bat ---------------------------------------- Command "C:\Users\s3z\Desktop\My Dropbox\pythons\renamover\Scripts \python.exe" -c "import setuptools;__file__='C:\\Users\\s3z\\Deskt op\\My Dropbox\\pythons\\renamover\\build\\pil\\setup.py';exec(compile (open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" inst all --single-version-externally-managed --record c:\users\s3z\appd ata\local\temp\pip-hyfdad-record\install-record.txt --install-headers "C:\Users\s3z\Desktop\My Dropbox\pythons\renamover\include\site\py thon2.7" failed with error code 1 in C:\Users\s3z\Desktop\My Dropb ox\pythons\renamover\build\pil Storing complete log in C:\Users\s3z\AppData\Roaming\pip\pip.log virtualenv Python解释器中尝试import pil时,我得到renamover,如下所示:

ImportError

那么如何在Windows Vista的virtualenv中使用(renamover) C:\Users\s3z\Desktop\My Dropbox\pythons\renamover>python Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD6 4)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pil Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named pil 正确安装pil

1 个答案:

答案 0 :(得分:0)

您可以尝试使用Pillow代替PIL兼容的fork。

即使在Linux上我也遇到PIL安装问题:)