pip installs can have unmet dependency on python-dev

Bug #1495705 reported by skierpage
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-pip (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I wanted to install the Python program https://github.com/wikimedia/ifttt

Its setup script has "pip install -r requirements.txt", so running `./setup` gives
  pip: command not found

OK, so I run `sudo apt-get install python-pip`, and Ubuntu installs pip (yay!).

Now retry `./setup` and it runs pip, but I get some " ERROR: /bin/sh: 1: xslt-config: not found" from which it continues, and then a " fatal error: pyconfig.h: No such file or directory". (more output below).

If you google this last error you find dozens reports of this problem installing a variety of packages. The fix is to install python-dev. But automation is *failing users* here. pip install should determine that some package requires the dev header files and realize that they're not around.

If you still have the output from `sudo apt-get install python-pip` around, a hint is there:
    Recommended packages:
      python-dev-all
(but this package doesn't exist! I'll file a separate bug)
And if you are knowledgeable enough to change the pip install line to `pip install --no-clean -r requirements.txt` you will find in INSTALL.txt, in the downloaded source for lxml in the temporary build directory, the comment:

    To install the required development packages of these dependencies
    on Linux systems, use your distribution specific installation tool,
    e.g. apt-get on Debian/Ubuntu::
      sudo apt-get install libxml2-dev libxslt-dev python-dev

The pip automation needs to do the right thing here instead of blowing up and making user after user google for the fix. (I realize this is easier said than done.)
Thanks!

--- console output ---
...
Downloading/unpacking lxml==3.4.2 (from -r requirements.txt (line 4))
...
    ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt
...
  Running setup.py install for lxml
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.2.
    Building without Cython.
    ERROR: /bin/sh: 1: xslt-config: not found

    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt
    building 'lxml.etree' extension
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/tmp/pip-build-Pfd52d/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
    src/lxml/lxml.etree.c:8:22: fatal error: pyconfig.h: No such file or directory
     #include "pyconfig.h"

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: python-pip 1.5.6-5ubuntu2
ProcVersionSignature: Ubuntu 3.19.0-28.30-generic 3.19.8-ckt5
Uname: Linux 3.19.0-28-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.4
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Sep 14 14:05:07 2015
InstallationDate: Installed on 2015-03-30 (167 days ago)
InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
PackageArchitecture: all
SourcePackage: python-pip
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
skierpage (skierpage) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-pip (Ubuntu):
status: New → Confirmed
Revision history for this message
Arvind Padmanabhan (arvindpdmn) wrote :

I am on 16.04 LTS. This is my problem:

$ sudo apt install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-dev : Depends: libpython-dev (= 2.7.11-1) but it is not going to be installed
              Depends: python2.7-dev (>= 2.7.11-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.