0

Following instructions from here I execute (I added sudo because otherwise it does not work):

sudo pip install python-pptx

As a result I get:

/home/my_name/present/build/lxml/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1

By searching in Internet for fatal error: libxml/xmlversion.h: No such file or directory I find these recommendations. It is said there that I need to execute:

sudo apt-get install libxml2-dev libxslt1-dev

If I execute this I get:

Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libx/libxml2/libxml2_2.8.0+dfsg1-5ubuntu2.5_i386.deb  404  Not Found [IP: 2001:67c:1360:8c01::18 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libx/libxslt/libxslt1.1_1.1.26-14ubuntu0.1_i386.deb  404  Not Found [IP: 2001:67c:1360:8c01::18 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libx/libxml2/libxml2-dev_2.8.0+dfsg1-5ubuntu2.5_i386.deb  404  Not Found [IP: 2001:67c:1360:8c01::18 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/libx/libxslt/libxslt1-dev_1.1.26-14ubuntu0.1_i386.deb  404  Not Found [IP: 2001:67c:1360:8c01::18 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

In the end of the above error message I have a recommendation (try with --fix-missing). OK, I try it with this option:

sudo apt-get install libxml2-dev libxslt1-dev --fix-missing

As a result I get:

Unable to correct missing packages.
E: Aborting install.

I gave up this way and tried easy_install:

sudo easy_install python-pptx

As a result I get:

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

Using build configuration of libxslt 
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
  warnings.warn(msg)
In file included from src/lxml/lxml.etree.c:239:0:
/tmp/easy_install-XE7O55/lxml-3.4.2/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

OK, since it is recommended to install libxml2 and libxslt, I try:

sudo easy_install libxml2

As a result I get:

Searching for libxml2
Reading http://pypi.python.org/simple/libxml2/
Couldn't find index page for 'libxml2' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for libxml2
error: Could not find suitable distribution for          Requirement.parse('libxml2')
Community
  • 1
  • 1
Roman
  • 124,451
  • 167
  • 349
  • 456
  • try `sudo apt-get --fix-missing install libxml2-dev libxslt-dev python-dev` – styvane Mar 05 '15 at 05:50
  • @Michael9, if I try it I get `Unable to correct missing packages.` – Roman Mar 05 '15 at 05:53
  • This [post](http://askubuntu.com/a/182872/363851) may help – styvane Mar 05 '15 at 05:57
  • @Michael9, I do not know how to find the "corrupt package" and the corresponding block in the file that has to be edited. – Roman Mar 05 '15 at 06:07
  • 1
    I think the issue here is that your package lists are too old. Try updating them with `sudo apt-get update` before installing the dev packages as @Michael9 suggested. – cel Mar 05 '15 at 08:04

0 Answers0