I use the Ubuntu system 16.04.1 (server).

When you enter pip install pillow , the installation is in progress, but at the end it gives an error:

  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2MM32Z/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MVcbrz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2MM32Z/pillow/ 

    2 answers 2

    To put in the system area, use:

     $ sudo apt install python3-imaging 

    Ubuntu packs a pillow library under this name in modern versions.

    If you want to install from sources (for example, in virtualenv), then put the headers python, With dependencies such as libjpeg. See the list of dependencies in the installation instructions . Or execute:

     $ sudo apt-get build-dep python3-imaging 

    and then re-compile run.

      Clean system or virtualka?

      Probably not enough dependencies, try running a command to install the Python 3 header files:

       sudo apt-get install python3-dev 
      • root@finansov14:~# apt-get install python-dev Чтение списков пакетов… Готово Построение дерева зависимостей Чтение информации о состоянии… Готово python-dev is already the newest version (2.7.11-1). python-dev установлен вручную. Возможно, для исправления этих ошибок вы захотите воспользоваться «apt-get -f install»: Пакеты, имеющие неудовлетворённые зависимости: libjpeg8-dev : Зависит: libjpeg8 (= 8d-1+deb7u1) но 8c-2ubuntu8 будет установлен E: Неудовлетворённые зависимости. Попытайтесь выполнить «apt-get -f install», не указывая имени пакета, (или найдите другое решение). - Max Snegirev
      • @MaxSnegirev here, run sudo apt-get -f install, then try the pillow again, and then we will look at the results - while1pass