Can't install Pillow


#1

Hi all,

I am trying to add images links to my database, and I have figured out that I need to use Pillow. When I try to use pip to install it, however, I get the following error:

ValueError: --enable-jpeg requested but jpeg not found, aborting.

After some serious googling, I think it is telling me that I need certain libraries that for whatever reason aren’t being installed with Pillow and don’t already exist on my machine. If so, how do I figure out which ones and how do I install them?

Thank you!!


#2

Hi! Are you following the procedure in Hello Web App: Intermediate Concepts, or working on your own? (Am confused by your “I have figured out that I need to use Pillow” part!)


#3

Hello! I am working through the Intermediate Concepts book. Sorry that wasn’t clear!


#4

So any ideas about how to get Pillow installed? I’ve read a bunch of SO questions and answers, but I don’t know enough code to implement the solutions…

Thanks!


#5

Sorry I didn’t get to your other question quickly, I’m working this morning.

Are you on PC or Mac?


#6

Oh, no rush. I just wasn’t sure if you’d seen it.

I’m on a Mac OS 10.7.5 using the Terminal to install.


#7

Hi,

Checking back in as I haven’t figured out how to install Pillow (or maybe just specific libraries?), and I can’t move forward with the image tutorial without it.

Thanks,
Sarah


#8

Sorry out of town at the moment.

You’re working in a virtual environment, right?


#9

No problem. Yes, I have followed all the setup instructions from the first tutorial, and I am in a virtual environment. Here are all the errors and messages I am seeing during one install attempt, in the order they are printed (some appear more than once). Any thoughts on how to troubleshoot?

Thank you!

warning: no previously-included files found matching '.editorconfig'
Installing collected packages: Pillow

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

warning: manifest_maker: standard file '-c' not found

warning: no previously-included files found matching '.editorconfig'

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/Users/sarahdawson/projects/pollstutorial/venv/build/Pillow/setup.py", line 767, in <module>

    zip_safe=not debug_build(),

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup

    dist.run_commands()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/Users/sarahdawson/projects/pollstutorial/venv/lib/python2.7/site-packages/setuptools/command/install.py", line 54, in run

    return _install.run(self)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 573, in run

    self.run_command('build')

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run

    self.run_command(cmd_name)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 340, in run

    self.build_extensions()

  File "/Users/sarahdawson/projects/pollstutorial/venv/build/Pillow/setup.py", line 516, in build_extensions

    (f, f))

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

----------------------------------------
Cleaning up...
Command /Users/sarahdawson/projects/pollstutorial/venv/bin/python -c "import setuptools, tokenize;__file__='/Users/sarahdawson/projects/pollstutorial/venv/build/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/5w/n7mg5z3n0vj0bf55phrhg31m0000gn/T/pip-qOzl5a-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sarahdawson/projects/pollstutorial/venv/bin/../include/site/python2.7 failed with error code 1 in /Users/sarahdawson/projects/pollstutorial/venv/build/Pillow
Storing debug log for failure in /Users/sarahdawson/.pip/pip.log

#10

Hmmm confusing.

Did you get any errors when you installed XCode? From these instructions: https://github.com/hellowebapp/hellowebapp/blob/master/installation-instructions/python-installation-mac.md

Sounds like some things are missing from XCode (guessing though).

(FYI — I’ll be back from the mountains on Sunday night or Monday, I’ll have to respond more then!)


#11

Hello, just popping by to let you know that I had the same error message in a Ubuntu virtual machine and solved it by installing the “libjpeg8-dev” package.

I do not know what the equivalent step would be under native OS X, but hopefully this gets you one step closer to the solution.


#12

see this ,may be because the Pillow 3.0.0 vesion above needs libjpeg. I have installed libjpeg8-dev first so ,Pillow I can install on Ubuntu no problem