Django - ValueError:请求了--enable-jpeg但找不到jpeg,正在中止

时间:2018-01-10 06:30:09

标签: python django

我是Django的初学者。我正在尝试创建一个在线商店。当我尝试使用" pip install Pillow == 3.0.0"安装Pillow时在Windows命令提示符中,出现以下错误:ValueError:--enable-jpeg已请求但未找到jpeg,正在中止。

滚动卸载枕头

如何解决此问题?

以下是错误的完整代码:

running install
running build
running build_py
creating build
creating build\lib.win32-3.6
creating build\lib.win32-3.6\PIL
copying PIL\BdfFontFile.py -> build\lib.win32-3.6\PIL
copying PIL\BmpImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\BufrStubImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\ContainerIO.py -> build\lib.win32-3.6\PIL
copying PIL\CurImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\DcxImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\EpsImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\ExifTags.py -> build\lib.win32-3.6\PIL
copying PIL\features.py -> build\lib.win32-3.6\PIL
copying PIL\FitsStubImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\FliImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\FontFile.py -> build\lib.win32-3.6\PIL
copying PIL\FpxImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\GbrImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\GdImageFile.py -> build\lib.win32-3.6\PIL
copying PIL\GifImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\GimpGradientFile.py -> build\lib.win32-3.6\PIL
copying PIL\GimpPaletteFile.py -> build\lib.win32-3.6\PIL
copying PIL\GribStubImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\Hdf5StubImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\IcnsImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\IcoImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\Image.py -> build\lib.win32-3.6\PIL
copying PIL\ImageChops.py -> build\lib.win32-3.6\PIL
copying PIL\ImageCms.py -> build\lib.win32-3.6\PIL
copying PIL\ImageColor.py -> build\lib.win32-3.6\PIL
copying PIL\ImageDraw.py -> build\lib.win32-3.6\PIL
copying PIL\ImageDraw2.py -> build\lib.win32-3.6\PIL
copying PIL\ImageEnhance.py -> build\lib.win32-3.6\PIL
copying PIL\ImageFile.py -> build\lib.win32-3.6\PIL
copying PIL\ImageFilter.py -> build\lib.win32-3.6\PIL
copying PIL\ImageFont.py -> build\lib.win32-3.6\PIL
copying PIL\ImageGrab.py -> build\lib.win32-3.6\PIL
copying PIL\ImageMath.py -> build\lib.win32-3.6\PIL
copying PIL\ImageMode.py -> build\lib.win32-3.6\PIL
copying PIL\ImageMorph.py -> build\lib.win32-3.6\PIL
copying PIL\ImageOps.py -> build\lib.win32-3.6\PIL
copying PIL\ImagePalette.py -> build\lib.win32-3.6\PIL
copying PIL\ImagePath.py -> build\lib.win32-3.6\PIL
copying PIL\ImageQt.py -> build\lib.win32-3.6\PIL
copying PIL\ImageSequence.py -> build\lib.win32-3.6\PIL
copying PIL\ImageShow.py -> build\lib.win32-3.6\PIL
copying PIL\ImageStat.py -> build\lib.win32-3.6\PIL
copying PIL\ImageTk.py -> build\lib.win32-3.6\PIL
copying PIL\ImageTransform.py -> build\lib.win32-3.6\PIL
copying PIL\ImageWin.py -> build\lib.win32-3.6\PIL
copying PIL\ImImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\ImtImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\IptcImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\Jpeg2KImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\JpegImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\JpegPresets.py -> build\lib.win32-3.6\PIL
copying PIL\McIdasImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\MicImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\MpegImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\MpoImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\MspImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\OleFileIO.py -> build\lib.win32-3.6\PIL
copying PIL\PaletteFile.py -> build\lib.win32-3.6\PIL
copying PIL\PalmImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PcdImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PcfFontFile.py -> build\lib.win32-3.6\PIL
copying PIL\PcxImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PdfImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PixarImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PngImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PpmImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PsdImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\PSDraw.py -> build\lib.win32-3.6\PIL
copying PIL\PyAccess.py -> build\lib.win32-3.6\PIL
copying PIL\SgiImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\SpiderImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\SunImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\TarIO.py -> build\lib.win32-3.6\PIL
copying PIL\TgaImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\TiffImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\TiffTags.py -> build\lib.win32-3.6\PIL
copying PIL\WalImageFile.py -> build\lib.win32-3.6\PIL
copying PIL\WebPImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\WmfImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\XbmImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\XpmImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\XVThumbImagePlugin.py -> build\lib.win32-3.6\PIL
copying PIL\_binary.py -> build\lib.win32-3.6\PIL
copying PIL\_util.py -> build\lib.win32-3.6\PIL
copying PIL\__init__.py -> build\lib.win32-3.6\PIL
running egg_info
writing Pillow.egg-info\PKG-INFO
writing dependency_links to Pillow.egg-info\dependency_links.txt
writing top-level names to Pillow.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Pillow.egg-info\SOURCES.txt'
copying PIL\OleFileIO-README.md -> build\lib.win32-3.6\PIL
running build_ext
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Kanon\AppData\Local\Temp\pip-build-8bgvjv4p\Pillow\setup.py", line 767, in <module>
    zip_safe=not debug_build(),
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "c:\users\kanon\appdata\local\programs\python\python36-32\lib\distutils\command\build_ext.py", line 339, in run
    self.build_extensions()
  File "C:\Users\Kanon\AppData\Local\Temp\pip-build-8bgvjv4p\Pillow\setup.py", line 515, in build_extensions
    % (f, f))
ValueError: --enable-jpeg requested but jpeg not found, aborting.
----------------------------------------
Rolling back uninstall of pillow

3 个答案:

答案 0 :(得分:0)

好的。我刚刚按照以下步骤解决了这个问题:

  1. 我以管理员身份运行命令提示符。然后我输入pip install --upgrade pip
  2. 我输入pip install --upgrade pillow
  3. 最后,我使用pip install Pillow
  4. 成功安装了Pillow

    就是这样!我希望这个解决方案能够帮助很多像我这样的初学者,他们在Django学习的初始阶段一直在摸索着。

答案 1 :(得分:0)

在库下安装

sudo apt-get install python-dev graphviz libgraphviz-dev pkg-config

答案 2 :(得分:0)

在Python 3.5.2上,运行以下cmmand。

sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk