pypoppler on windows

Asked by dbozic

Hi folks,
I am currently trying to port py-poppler to windows. In fact compilation (with poppler-8.3) was a bit painful but worked finally. Here the compiler/installe output:

$ make
make all-recursive
make[1]: Entering directory `/c/mingw/pypoppler-0.8.1'
Making all in demo
make[2]: Entering directory `/c/mingw/pypoppler-0.8.1/demo'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/c/mingw/pypoppler-0.8.1/demo'
make[2]: Entering directory `/c/mingw/pypoppler-0.8.1'
if /c/gnu/GetGnuWin32/gnuwin32/bin/libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -Ic:/Python25/include/python2.5 -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Ic:/GTK/include/glib-2.0 -Ic:/GTK/lib/glib-2.0/include -Ic:/GTK/include/atk-1.0 -Ic:/GTK/include/poppler/glib -Ic:/GTK/include/poppler -Ic:/GTK/include/gtk-2.0 -Ic:/GTK/lib/gtk-2.0/include -Ic:/GTK/include/cairo -Ic:/GTK/include/pango-1.0 -Ic:/GTK/include/freetype2 -Ic:/GTK/include/libpng13 -Ic:/GTK/include/pixman-1 -Ic:/Python25/include/pygtk-2.0 -Ic:/Python25/include/pycairo -mno-cygwin -mms-bitfields -fgnu89-inline -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Wall -std=c9x -fno-strict-aliasing -MT poppler_la-popplermodule.lo -MD -MP -MF ".deps/poppler_la-popplermodule.Tpo" -c -o poppler_la-popplermodule.lo `test -f 'popplermodule.c' || echo './'`popplermodule.c; \
then mv -f ".deps/poppler_la-popplermodule.Tpo" ".deps/poppler_la-popplermodule.Plo"; else rm -f ".deps/poppler_la-popplermodule.Tpo"; exit 1; fi
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I. -Ic:/Python25/include/python2.5 -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Ic:/GTK/include/glib-2.0 -Ic:/GTK/lib/glib-2.0/include -Ic:/GTK/include/atk-1.0 -Ic:/GTK/include/poppler/glib -Ic:/GTK/include/poppler -Ic:/GTK/include/gtk-2.0 -Ic:/GTK/lib/gtk-2.0/include -Ic:/GTK/include/cairo -Ic:/GTK/include/pango-1.0 -Ic:/GTK/include/freetype2 -Ic:/GTK/include/libpng13 -Ic:/GTK/include/pixman-1 -Ic:/Python25/include/pygtk-2.0 -Ic:/Python25/include/pycairo -mno-cygwin -mms-bitfields -fgnu89-inline -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Wall -std=c9x -fno-strict-aliasing -MT poppler_la-popplermodule.lo -MD -MP -MF .deps/poppler_la-popplermodule.Tpo -c popplermodule.c -DDLL_EXPORT -DPIC -o .libs/poppler_la-popplermodule.o
(cd .\
&& /c/Python25/python C:/Python25/Lib/site-packages/gtk-2.0/codegen/codegen.py \
        --override poppler.override \
    --register c:/Python25/share/pygtk/2.0/defs/gdk-types.defs \
    --register c:/Python25/share/pygtk/2.0/defs/pango-types.defs \
    --register c:/Python25/share/pygtk/2.0/defs/gtk-types.defs \
        --prefix py_poppler poppler.defs) > gen-poppler.c \
    && cp gen-poppler.c poppler.c \
    && rm -f gen-poppler.c
Could not write method PopplerAnnotMarkup.get_date: No ArgType for GDate*
Could not write method PopplerPage.get_thumbnail: No ArgType for cairo_surface_t*
Could not write method PopplerPage.get_image: No ArgType for cairo_surface_t*
Could not write method PopplerAttachment.save_to_callback: No ArgType for PopplerAttachmentSaveFunc
Warning: generating old-style constructor for:poppler_font_info_new
Could not write function poppler_error_quark: No ArgType for GQuark
Could not write function poppler_page_free_link_mapping: No ArgType for GList*
Could not write function poppler_page_free_image_mapping: No ArgType for GList*
Could not write function poppler_page_free_form_field_mapping: No ArgType for GList*
Could not write function poppler_page_free_annot_mapping: No ArgType for GList*
Warning: Constructor for PopplerFontInfo needs to be updated to new API
         See http://live.gnome.org/PyGTK_2fWhatsNew28#update-constructors
***INFO*** The coverage of global functions is 44.44% (4/9)
***INFO*** The coverage of methods is 95.70% (89/93)
***INFO*** There are no declared virtual proxies.
***INFO*** There are no declared virtual accessors.
***INFO*** There are no declared interface proxies.
if /c/gnu/GetGnuWin32/gnuwin32/bin/libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -Ic:/Python25/include/python2.5 -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Ic:/GTK/include/glib-2.0 -Ic:/GTK/lib/glib-2.0/include -Ic:/GTK/include/atk-1.0 -Ic:/GTK/include/poppler/glib -Ic:/GTK/include/poppler -Ic:/GTK/include/gtk-2.0 -Ic:/GTK/lib/gtk-2.0/include -Ic:/GTK/include/cairo -Ic:/GTK/include/pango-1.0 -Ic:/GTK/include/freetype2 -Ic:/GTK/include/libpng13 -Ic:/GTK/include/pixman-1 -Ic:/Python25/include/pygtk-2.0 -Ic:/Python25/include/pycairo -mno-cygwin -mms-bitfields -fgnu89-inline -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Wall -std=c9x -fno-strict-aliasing -MT poppler_la-poppler.lo -MD -MP -MF ".deps/poppler_la-poppler.Tpo" -c -o poppler_la-poppler.lo `test -f 'poppler.c' || echo './'`poppler.c; \
then mv -f ".deps/poppler_la-poppler.Tpo" ".deps/poppler_la-poppler.Plo"; else rm -f ".deps/poppler_la-poppler.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I. -Ic:/Python25/include/python2.5 -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Ic:/GTK/include/glib-2.0 -Ic:/GTK/lib/glib-2.0/include -Ic:/GTK/include/atk-1.0 -Ic:/GTK/include/poppler/glib -Ic:/GTK/include/poppler -Ic:/GTK/include/gtk-2.0 -Ic:/GTK/lib/gtk-2.0/include -Ic:/GTK/include/cairo -Ic:/GTK/include/pango-1.0 -Ic:/GTK/include/freetype2 -Ic:/GTK/include/libpng13 -Ic:/GTK/include/pixman-1 -Ic:/Python25/include/pygtk-2.0 -Ic:/Python25/include/pycairo -mno-cygwin -mms-bitfields -fgnu89-inline -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Wall -std=c9x -fno-strict-aliasing -MT poppler_la-poppler.lo -MD -MP -MF .deps/poppler_la-poppler.Tpo -c poppler.c -DDLL_EXPORT -DPIC -o .libs/poppler_la-poppler.o
/c/gnu/GetGnuWin32/gnuwin32/bin/libtool --tag=CC --mode=link gcc -mno-cygwin -mms-bitfields -fgnu89-inline -I/include -I/c/Python25/include -I/c/Python25/include/pycairo -I/c/Python25/include/pygtk-2.0 -I/c/GTK/include/poppler -I/c/GTK/include/poppler/glib -I/c/GTK/include/poppler/goo -I/c/GTK/include/glib-2.0 -I/c/GTK/lib/glib-2.0/include -Wall -std=c9x -fno-strict-aliasing -L/c/GTK/lib -L/c/GTK/bin -L/c/Python25/libs -lpython25 -o poppler.la -rpath /c/Python25/Lib/site-packages -module -avoid-version -export-symbols-regex initpoppler poppler_la-popplermodule.lo poppler_la-poppler.lo -Lc:/GTK/lib -Lc:/Python25/lib -latk-1.0 -lffi -lpoppler-glib -lgdk-win32-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -lcairo
/c/gnu/GetGnuWin32/gnuwin32/bin/libtool: /: is a directory
generating symbol list for `poppler.la'
nm .libs/poppler_la-popplermodule.o .libs/poppler_la-poppler.o | sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 _\2 \2/p' | /usr/bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/' -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > .libs/poppler.exp
/usr/bin/grep -E -e "initpoppler" ".libs/poppler.exp" > ".libs/poppler.expT"
mv -f ".libs/poppler.expT" ".libs/poppler.exp"
if test "x`/usr/bin/sed 1q .libs/poppler.exp`" = xEXPORTS; then cp .libs/poppler.exp .libs/poppler.dll.def; else echo EXPORTS > .libs/poppler.dll.def; cat .libs/poppler.exp >> .libs/poppler.dll.def; fi
 gcc -shared .libs/poppler.dll.def .libs/poppler_la-popplermodule.o .libs/poppler_la-poppler.o -L/c/GTK/lib -L/c/GTK/bin -L/c/Python25/libs -lpython25 -Lc:/GTK/lib -Lc:/Python25/lib -latk-1.0 /c/Gtk/lib/libffi.a /c/Gtk/lib/libpoppler-glib.dll.a -L/c/Gtk/lib -lgdk-win32-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -lcairo -mno-cygwin -mms-bitfields -o .libs/poppler.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/poppler.dll.a
Creating library file: .libs/poppler.dll.a
creating poppler.la
(cd .libs && rm -f poppler.la && cp -fp ../poppler.la poppler.la)
make[2]: Leaving directory `/c/mingw/pypoppler-0.8.1'
make[1]: Leaving directory `/c/mingw/pypoppler-0.8.1'

dbozic@MATL-D21 /c/mingw/pypoppler-0.8.1
$ make install
Making install in demo
make[1]: Entering directory `/c/mingw/pypoppler-0.8.1/demo'
make[2]: Entering directory `/c/mingw/pypoppler-0.8.1/demo'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/c/mingw/pypoppler-0.8.1/demo'
make[1]: Leaving directory `/c/mingw/pypoppler-0.8.1/demo'
make[1]: Entering directory `/c/mingw/pypoppler-0.8.1'
make[2]: Entering directory `/c/mingw/pypoppler-0.8.1'
test -z "/c/Python25/Lib/site-packages" || mkdir -p -- "/c/Python25/Lib/site-packages"
 /c/gnu/GetGnuWin32/gnuwin32/bin/libtool --mode=install /bin/install -c 'poppler.la' '/c/Python25/Lib/site-packages/poppler.la'
/bin/install -c .libs/poppler.dll.a /c/Python25/Lib/site-packages/poppler.dll.a
base_file=`basename ${file}`
 dlpath=`/bin/sh 2>&1 -c '. .libs/'${base_file}'i;echo $dlname'`
 dldir=/c/Python25/Lib/site-packages/`dirname $dlpath`
 test -d $dldir || mkdir -p $dldir
 /bin/install -c .libs/poppler.dll $dldir/poppler.dll
 chmod a+x $dldir/poppler.dll
/bin/install -c .libs/poppler.lai /c/Python25/Lib/site-packages/poppler.la
----------------------------------------------------------------------
Libraries have been installed in:
   /c/Python25/Lib/site-packages

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-LLIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/c/mingw/pypoppler-0.8.1'
make[1]: Leaving directory `/c/mingw/pypoppler-0.8.1'

dbozic@MATL-D21 /c/mingw/pypoppler-0.8.1
$ cd /c/Python25/Lib/site-packages/

dbozic@MATL-D21 /c/Python25/Lib/site-packages
$ ls -l
total 1111
drwxr-xr-x 14 dbozic Administ 0 Jun 12 14:05 OpenGL
drwxr-xr-x 2 dbozic Administ 0 Jun 12 14:05 PyOpenGL-3.0.0b1-py2.5.egg-info
-rw-r--r-- 1 dbozic Administ 2141131 Sep 23 2006 PyWin32.chm
-rw-r--r-- 1 dbozic Administ 121 Oct 28 2005 README.txt
drwxr-xr-x 2 dbozic Administ 0 Jun 12 14:05 cairo
drwxr-xr-x 5 dbozic Administ 0 Jun 12 14:06 deseb
drwxr-xr-x 20 dbozic Administ 0 Jun 12 14:07 django
drwxr-xr-x 7 dbozic Administ 0 Jun 17 12:40 gpapers
drwxr-xr-x 5 dbozic Administ 0 Jun 12 14:05 gtk-2.0
drwxr-xr-x 5 dbozic Administ 0 Jun 12 14:05 isapi
-rwxr-xr-x 1 dbozic Administ 109880 Jun 17 13:14 poppler.dll
-rw-r--r-- 1 dbozic Administ 1420 Jun 17 13:14 poppler.dll.a
-rw-r--r-- 1 dbozic Administ 1112 Jun 17 13:14 poppler.la
-rw-r--r-- 1 dbozic Administ 211 Feb 9 15:40 pycairo-1.4.12-py2.5.egg-info
-rw-r--r-- 1 dbozic Administ 7 Jun 12 14:05 pygtk.pth
-rw-r--r-- 1 dbozic Administ 2946 Nov 5 2007 pygtk.py
-rw-r--r-- 1 dbozic Administ 2068 Jun 12 14:08 pygtk.pyc
-rw-r--r-- 1 dbozic Administ 1775 Jun 12 14:05 pygtk.pyo
-rw-r--r-- 1 dbozic Administ 141 Jan 26 2004 pythoncom.py
-rw-r--r-- 1 dbozic Administ 245 Jun 12 14:05 pythoncom.pyc
-rw-r--r-- 1 dbozic Administ 245 Jun 12 14:05 pythoncom.pyo
drwxr-xr-x 3 dbozic Administ 0 Jun 12 14:04 pythonwin
-rw-r--r-- 1 dbozic Administ 450 Sep 23 2006 pywin32-210-py2.6.egg-info
-rw-r--r-- 1 dbozic Administ 69 Oct 10 2004 pywin32.pth
-rw-r--r-- 1 dbozic Administ 5 Sep 23 2006 pywin32.version.txt
drwxr-xr-x 2 dbozic Administ 0 Jun 12 14:04 pywin32_system32
drwxr-xr-x 2 dbozic Administ 0 Jun 17 12:27 readline
-rw-r--r-- 1 dbozic Administ 231 Jun 17 12:18 readline-1.12-py2.5.egg-info
drwxr-xr-x 8 dbozic Administ 0 Jun 12 14:04 win32
drwxr-xr-x 12 dbozic Administ 0 Jun 12 14:05 win32com
drwxr-xr-x 13 dbozic Administ 0 Jun 12 14:04 win32comext

But when I start python from comman line and type: import poppler , or run the demo program I get:
$ python demo-poppler.py
Traceback (most recent call last):
  File "demo-poppler.py", line 20, in <module>
    import poppler
ImportError: No module named poppler

Any Idea about this point ???????

Thanks a lot in advance

db

Question information

Language:
English Edit question
Status:
Expired
For:
Poppler Python Bindings Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Bernhard Reiter (ockham-razor) said :
#2

Hi,

did you ever succeed? I'm currently also trying to get poppler-python running on windows (and even asked about officially maintainence plans, see bug #499592). Unfortunately, I don't have too much MinGW/msys experience, so I'm currently even stuck at ./configure stage -- which fails with

checking for a Python interpreter with version >= 2.2... python
checking for python... /c/PROGRA~1/Python26//python
checking for python version... 2.6
checking for python platform... win32
checking for python script directory... ${prefix}\Lib\site-packages
checking for python extension module directory... ${exec_prefix}\Lib\site-packages
checking for headers required to compile python extensions... not found
configure: error: could not find Python headers

Can you give me some hint about how you got it to build? Maybe we can get the whole thing to work...
Bernhard