1

I tried to install pillow inside a virtualenv under the interpreter:

$VIRTUAL_ENV/bin/python3.4

I used the command:

pip install pillow

and got the following error:

Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-d3yi7nax/pillow/setup.py", line 753, in <module>
        zip_safe=not debug_build(), )
      File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/attila/qr-code-backend/qr-backend-env/lib/python3.4/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.4/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.4/distutils/command/build.py", line 126, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.4/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/tmp/pip-build-d3yi7nax/pillow/setup.py", line 521, in build_extensions
        ' using --disable-%s, aborting' % (f, f))
    ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

The full output: http://pastebin.com/QMSy0pKk

I tried:

~ pip install -U pip

Using python2.7

installing pillow with apt, then trying pip virtualenv install again

Other info

I can install other packages like picamera, ipython etc...

I can install a fully functional pillow via apt.

Some other packages show similar pattern when I tried to install them inside a virtualenv:

for example zbar python module gives the following error:

zbarmodule.h:24:20: fatal error: Python.h: No such file or directory

 #include <Python.h>

                    ^

compilation terminated.

error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

My guess is the includes are not or faulty sat on the system. (Raspbian Jessie light 2016-03-18)

  • shouldn't you be using pip3 install puppet, if you are using python3? – Steve Robillard Jul 6 '16 at 8:19
  • @SteveRobillard If you inside a virtualenv the pip command will refer to the pip inside the virtualenv and NOT the pip of your system, and it will correspond to your chosen python version. docs.python-guide.org/en/latest/dev/virtualenvs – atevm Jul 6 '16 at 8:47
  • That is true but shouldn't your python interreter be in yout virtualenv directory not /usr/bin/python3.4? What is the output of which python when in the virtualenv? – Steve Robillard Jul 6 '16 at 8:48
  • @SteveRobillard my bad it was inside the virtualenv (see updated answer). I falsely assumed that the virtualenv command makes sym link instead of copying. The output of python --version is: Python 3.4.2 – atevm Jul 6 '16 at 8:59
  • It's always okay to post an answer to your own question, and to accept it. Future readers will benefit and you may pick up a few rep points. – uhoh Jun 29 '18 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.