-
Notifications
You must be signed in to change notification settings - Fork 49
trying to install pyvips with binary libvips #180
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
Comments
Hello @ccellado During install in API mode, setuptools will generate some C source code for the low-level parts of the binding, then build them against the libvips headers and make a python module called To do this, it needs a C compiler, the libvips shared library ( To test your libvips install, try:
And see if you get a set of compiler flags. |
Thanks , @jcupitt! Through some tough luck and drag'n'drop sorcery i was able to setup pyvips in a python venv, but i've got a different problem. When i run testing scripts (wobble,py from your reps) i've got :
I've had the same error when tried conda install, but did not bother to look at it closer. What could it be? |
Sorry, I don't know. You can run python in a debugger and see if you can get a stacktrace, that might help. If you can build with debugging on, even better. |
I had a quick look, and nix seems to include vips-8.9.1. I would just do:
And it should work. I'd ask a nixos expert for help, I don't really know anything about it. |
I've made 8.9.2 version of vips, should building it debug version help? Could it be that i've created corrupted API module, well, my pointing installer to the things it wanted? I've missed something or symlinks blew it? |
A debug version would make a backtrace from the crash easier to understand. You can use pip in nixos, eg.:
I wouldn't make symlinks, it's pretty dangerous. I would just install the nixos vips and use |
I've made a lot of progress, trying to add pyvips to nix repository. How can I find out for sure? Installing logs ( nix building of package ) did not tell me enough. In my mockup env I have to export LD_LIBRARY_PATH, and when it's missing the traceback shows ***/cffi/api.py files trying to access lib. Is that and asnwer? Thank you. |
Hello @ccellado, You can get the library version like this:
pyvips checks that the API and ABI match during startup, so the headers will always be the same. You can test the wrapper mode like this:
And get the pyvips version in the obvious way:
|
$ pip show pyvips
Name: pyvips
Version: 2.1.12
Summary: binding for the libvips image processing library, API mode
Home-page: https://github.com/libvips/pyvips
Author: John Cupitt
Author-email: jcupitt@gmail.com
License: MIT
Location: /usr/local/lib64/python3.8/site-packages
Requires: cffi, pkgconfig
Required-by: |
I checked and it is in ABI mode.
Thanks |
The ABI/API mode detect happens during pip install. It tries to compile the binding for API mode and falls back to ABI mode if the compile fails. The compile can fail for many reasons, eg. missing libvips headers, You can use the
It produces a /lot/ of output, unfortunately. |
Here's what I see for a successful API mode install: Sample `pip install pyvips --verbose` output
|
You could also try the patch from here: #84 (comment). This patch ensures that it will print details if @jcupitt That patch fell of my radar. Should I make a PR? It also ensures that these messages are printed during installation with Lines 6 to 10 in 4d9ae15
|
log the exception on API install fail see #180
Oh, I forgot about that too. It's only a few lines of code -- I pasted your patch in. |
Ok, I've done it - pyvips now in nixpkgs ( git latest rep ) in API mode. Thanks to all! |
@jcupitt And now ofc you can mention that the package available via nix. |
System - NixOS
Hello, i've trying to pyvips to work in a python venv.
Installation skips to cffi ABI mode, fails there too. But i want to get the API mode.
What does it exactly mean to have libvips with dev headers installed?
From the trace i can see that "import _libvips" couldn't any. Where does it look?
Nix have vips package, but no -dev version. I could make my own -dev version of it, but how does it differ.
Thanks!
The text was updated successfully, but these errors were encountered: