Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install Vips and some dependencies seem to be corrupted. #315

Closed
alfredox10 opened this issue Jul 23, 2015 · 9 comments
Closed

Comments

@alfredox10
Copy link

So I am running the ./configure from the package I got from your site and this is the output it produces:

  • build options
    native win32: no
    native OS X: no
    open files in binary mode: no
    enable debug: no
    build deprecated components: yes
    build docs with gtkdoc: no
    gobject introspection: no
    build vips7 Python binding: yes
    install vips8 Python overrides: no
    (requires pygobject-3.12.0 or later)
  • optional dependencies
    use fftw3 for FFT: yes
    Magick package: MagickWand
    file import with libMagick: yes
    accelerate loops with orc: yes
    (requires orc-0.4.11 or later)
    ICC profile support with lcms: yes (lcms2)
    file import with OpenEXR: yes
    file import with OpenSlide: yes
    (requires openslide-3.3.0 or later)
    file import with matio: yes
    file import with cfitsio: yes
    file import/export with libwebp: yes
    text rendering with pangoft2: yes
    file import/export with libpng: yes (pkg-config libpng >= 1.2.9)
    (requires libpng-1.2.9 or later)
    file import/export with libtiff: yes (pkg-config libtiff-4)
    file import/export with libjpeg: yes
    image pyramid export: yes
    (requires libgsf-1 1.14.27 or later)
    use libexif to load/save JPEG metadata: yes

So it's saying I need gobject introspection and gtkdoc, which I thought I already had installed. So I went back and tried to install gobject first using Synaptic Package Manager but it kept giving a dependency error. So then I used this command:
sudo apt-get install gobject-introspection

and this is what I get:
The following packages have unmet dependencies:
gobject-introspection : Depends: libgirepository-1.0-1 (= 1.40.0-1) but 1.40.0-1ubuntu0.2 is to be installed
E: Unable to correct problems, you have held broken packages.
alfredo@alfpc-ubuntu:~/Downloads/dependencies/gobject-introspection-1.44.0$

Can you help me resolve this?

Thanks,

Alfredo

@alfredox10
Copy link
Author

It seems like I have everything done for my install, includding the Vips8 binding according to the ./configure output. But that file isn't getting created. Everything else is there includding the gi dir and the Vips.py in the override dir.

Can I just download this file and paste it where it's supposed to go or how can i fix this?

  • build options
    native win32: no
    native OS X: no
    open files in binary mode: no
    enable debug: no
    build deprecated components: yes
    build docs with gtkdoc: no
    gobject introspection: yes
    build vips7 Python binding: yes
    install vips8 Python overrides: yes
    (requires pygobject-3.12.0 or later)
  • optional dependencies
    use fftw3 for FFT: yes
    Magick package: MagickWand
    file import with libMagick: yes
    accelerate loops with orc: yes
    (requires orc-0.4.11 or later)
    ICC profile support with lcms: yes (lcms2)
    file import with OpenEXR: yes
    file import with OpenSlide: yes
    (requires openslide-3.3.0 or later)
    file import with matio: yes
    file import with cfitsio: yes
    file import/export with libwebp: yes
    text rendering with pangoft2: yes
    file import/export with libpng: yes (pkg-config libpng >= 1.2.9)
    (requires libpng-1.2.9 or later)
    file import/export with libtiff: yes (pkg-config libtiff-4)
    file import/export with libjpeg: yes
    image pyramid export: yes
    (requires libgsf-1 1.14.27 or later)
    use libexif to load/save JPEG metadata: yes

@jcupitt
Copy link
Member

jcupitt commented Jul 23, 2015

Hi @alfredox10, I would fix the synaptic problem first. Try something like:

http://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages

Your typelib problem is strange. Is the .gir file being created? After compiling, I see:

john@katamata ~/GIT/libvips (master) $ ls libvips/Vips*
libvips/Vips-8.0.gir     libvips/Vips-8.0.typelib

@alfredox10
Copy link
Author

I was able to fix the synaptic problem with aptitude, thanks!

Here is the output of my latest run of ./configure, everything seems to be in place: http://pastebin.com/FPesqTma

However when I run make it's a different story. It doesn't seem like it works: http://pastebin.com/FefDcF3T

@jcupitt
Copy link
Member

jcupitt commented Jul 25, 2015

I'd guess you have a broken package: only part of one of the gobject-introspection things seems to be there. Perhaps something crashed or quit half-way through install?

I see:

$ apt-file search g-ir-scanner
gobject-introspection: /usr/bin/g-ir-scanner

Maybe try uninstalling and reinstalling gobject-introspection:

$ sudo apt-get remove gobject-introspection
$ sudo apt-get install gobject-introspection libgirepository1.0-dev

@alfredox10
Copy link
Author

For some reason that still didn't work. I thought everything looked good after running make. But I get this error when I run import of vips:
In [1]: from gi.repository import Vips
Out [1]: Error:root:Could not find any typelib for Vips

ImportError Traceback (most recent call last)
in ()
----> 1 from gi.repository import Vips

ImportError: cannot import name Vips

So I am not sure why it's still failing.
These files seem to be in place:
/usr/bin/g-ir-scanner
/usr/lib/gobject-introspection/giscanner/
However the typelib file for Vips is still not inside /usr/lib/girepository-1.0/, I think that's the last missing component. What command specifically generates that, is it the make?

configure output: http://pastebin.com/i7jyMAkX
make output: https://www.dropbox.com/s/y30uu2uki99g541/vips-make-output-2.txt?dl=0

@jcupitt
Copy link
Member

jcupitt commented Jul 25, 2015

It all looks OK I think. You need to make install to copy the files to their destinations, and you may need to set GI_TYPELIB_PATH to point to Vips-8.0.typelib.

There some more notes in the Python docs, I guess you saw?

http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/libvips/using-from-python.html

@alfredox10
Copy link
Author

It works now but I had to additionally do these steps:

  1. sudo apt-get install python-gobject-dev
  2. I manually copied these files:
    vips-8.0.2/libvips/Vips-8.0.typelib to /usr/lib/girepository-1.0/
    'vips-8.0.2/libvips/Vips.py' to /usr/lib/python2.7/dist-packages/gi/overrides/

I am not sure if step #2 should have been done automatically during the make step, but after I did it myself, it works :D.

Additionally, I am having trouble finding a good API guide to use the code in python, I only found this but it doesn't really mention everything I can do with a VipImage object.
http://www.vips.ecs.soton.ac.uk/index.php?title=Python
http://www.vips.ecs.soton.ac.uk/supported/7.42/doc/html/libvips/using-from-python.html

Is there something else? I want to put the image into a numpy 3D array similar to how PIL images automatically get processed this way:
In[1]: import numpy
In[2]: from PIL import Image
In[3]: image = Image.open('43.jpg')
In[4]: image
Out[4]: <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=3216x2136 at 0x7F34CC1876C8>
In[5]: imgArray2 = numpy.asarray(image, dtype=numpy.float32)
In[6]: imgArray2.shape
Out[6]: (2136, 3216, 3)

@alfredox10
Copy link
Author

Ok so I've been testing the functionality and the problem seems to be resolved, I'll go ahead and make a new post for my next question.

Thanks!

@jcupitt
Copy link
Member

jcupitt commented Jul 26, 2015

Hey, great it's working This will become simple once vips8 is packaged by Debian, but for now it's rather a manual process :-(

On 2., it's best to set GI_TYPELIB_PATH so that Python can pick up the Vips-8.0.typelib file. Unfortunately there's no variable you can set for Vips.py, you do need to copy that to the system area. The Python docs talk about this:

http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/libvips/using-from-python.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants