Python命令PIP在Windows中安装枕头出现错误


building 'PIL._imaging' extension
  error: [WinError 2] The system cannot find the file specified
  ----------------------------------------
  Failed building wheel for Pillow
Failed to build Pillow
Installing collected packages: Pillow
  Running setup.py install for Pillow
    Complete output from command c:usersanilkumar.vandrangidesktopaspirepython.exe -c "import setuptools, tokenize;__file__='C:\Users\ANILKU~1.VAN\AppData\Local\Temp\pip-build-tr4denzb\Pil
low\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record C:UsersANILKU~1.VANAppDataLocalTemppip-7zffvlgz-recordin
stall-record.txt --single-version-externally-managed --compile:
    Single threaded build, not installing mp_compile: 4 processes
    running install
    running build
    running build_py
    running egg_info
    writing top-level names to Pillow.egg-infotop_level.txt
    writing Pillow.egg-infoPKG-INFO
    writing dependency_links to Pillow.egg-infodependency_links.txt
    warning: manifest_maker: standard file '-c' not found
    reading manifest file 'Pillow.egg-infoSOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'Pillow.egg-infoSOURCES.txt'
    running build_ext
    building 'PIL._imaging' extension
    error: [WinError 2] The system cannot find the file specified
    ----------------------------------------
Command "c:usersanilkumar.vandrangidesktopaspirepython.exe -c "import setuptools, tokenize;__file__='C:\Users\ANILKU~1.VAN\AppData\Local\Temp\pip-build-tr4denzb\Pillow\setup.py';exec(comp
ile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record C:UsersANILKU~1.VANAppDataLocalTemppip-7zffvlgz-recordinstall-record.txt --singl
e-version-externally-managed --compile" failed with error code 1 in C:UsersANILKU~1.VANAppDataLocalTemppip-build-tr4denzbPillow

我假设您使用的是x64位Windows。

清洁的方法来解决它:如果您已经安装了32位版本的python:卸载它安装64位在安装过程中,选择将python添加到path下载64位版本的枕头:http://wp.stolaf.edu/it/installing-pil-pillow-cimage-on-windows-and-mac/运行安装文件。

检查您的Pip版本,看看是否有最新版本可用。

C: python3 -m pip install --version

您可以使用python或python3,我使用python3是因为我在同一个磁盘上有2.7和3.5。

如果你的版本不是最新的,使用:

C: python3 -m pip install --upgrade pip

现在尝试pip install Pillow:

C: python3 -m pip install Pillow

你得到这个错误是因为你试图安装的枕头版本与你的python版本不兼容。

尝试升级两者作为最后的手段。

最新更新