-
Notifications
You must be signed in to change notification settings - Fork 49
pyvips installs in abi mode despite vips being present #84
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
Yes, just set PKG_CONFIG_PATH, I think.
…On Fri, 8 Mar 2019 at 18:55, Sajid Ali ***@***.***> wrote:
Is there an argument I can pass to pyvips to find a local install of
libvips ?
(ipy3) ***@***.*** ~]$ which vips
~/packages/spack/opt/spack/linux-centos7-x86_64/gcc-8.3.0/libvips-8.7.4-rilxe37cjuisabs3kzapoljmdcr7jivc/bin/vips
(ipy3) ***@***.*** ~]$ pip install --user pyvips
Collecting pyvips
Requirement already satisfied: cffi>=1.0.0 in ./miniconda3/envs/ipy3/lib/python3.6/site-packages (from pyvips)
Requirement already satisfied: pycparser in ./miniconda3/envs/ipy3/lib/python3.6/site-packages (from cffi>=1.0.0->pyvips)
Installing collected packages: pyvips
Successfully installed pyvips-2.1.5
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(ipy3) ***@***.*** ~]$ pip show pyvips
Name: pyvips
Version: 2.1.5
Summary: binding for the libvips image processing library, ABI mode
Home-page: https://github.com/libvips/pyvips
Author: John Cupitt
Author-email: ***@***.***
License: MIT
Location: /home/sajid/.local/lib/python3.6/site-packages
Requires: cffi
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(ipy3) ***@***.*** ~]$
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#84>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjc62yBw_tYS1bi6ZisHFMtMbc6c5_Jks5vUrIrgaJpZM4bl7kp>
.
|
No effect.
|
I don’t think you can use ~ in env vars, can you? I’m on my phone, so I
can’t check until tomorrow.
…On Fri, 8 Mar 2019 at 19:22, Sajid Ali ***@***.***> wrote:
No effect.
(ipy3) ***@***.*** ~]$ which vips
~/packages/spack/opt/spack/linux-centos7-x86_64/gcc-8.3.0/libvips-8.7.4-rilxe37cjuisabs3kzapoljmdcr7jivc/bin/vips
(ipy3) ***@***.*** ~]$ export PKG_CONFIG_PATH=~/packages/spack/opt/spack/linux-centos7-x86_64/gcc-8.3.0/libvips-8.7.4-rilxe37cjuisabs3kzapoljmdcr7jivc
(ipy3) ***@***.*** ~]$ pip install --user pyvips
Collecting pyvips
Requirement already satisfied: cffi>=1.0.0 in ./miniconda3/envs/ipy3/lib/python3.6/site-packages (from pyvips)
Requirement already satisfied: pycparser in ./miniconda3/envs/ipy3/lib/python3.6/site-packages (from cffi>=1.0.0->pyvips)
Installing collected packages: pyvips
Successfully installed pyvips-2.1.5
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(ipy3) ***@***.*** ~]$ pip show pyvips
Name: pyvips
Version: 2.1.5
Summary: binding for the libvips image processing library, ABI mode
Home-page: https://github.com/libvips/pyvips
Author: John Cupitt
Author-email: ***@***.***
License: MIT
Location: /home/sajid/.local/lib/python3.6/site-packages
Requires: cffi
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(ipy3) ***@***.*** ~]$
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#84 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAjc6zAeZWTGxis0JFgINQ-Yb4e7rl4iks5vUrhxgaJpZM4bl7kp>
.
|
Doing that didn't help, but you can see what's the correct way to do it tomorrow. No worries. |
You're missing the
Assuming that If that doesn't work, try this:
|
I'm not sure why that's not helping. Confirm that we have vips with pkgconfig info installed :
Confirm that we have vips and a working C compiler (and the same version of pkgconfig loaded just to be safe) :
Now, set the env var as suggested and install :
Did it succeed in building an API build ? No.
And doing what @kleisauke suggested didn't work either :
|
You can check whether libvips is available and whether a sufficient version is installed (after exporting the
It is also possible that the compilation process of the API mode fails, and as a result, the ABI mode is installed. You can check this with the
This will produce a large amount of output messages, you should look for When it successfully compiles the API mode, I see this: Output
|
I usually do this to test
So you can see it'll link to the vips in my home area. |
And I have:
|
Confirm that I have vips>8.2 :
Confirm that the other libraries needed by pyvips are loaded :
Since these libraries are loaded via modules, the PKG_CONFIG_PATH should be set automatically. Let's confirm that :
Now uninstall the previous pyvips :
Now install it again with the verbose flag :
Still in ABI mode :(
|
Oh, are you using anaconda? They have their own package system, you can't use regular system binaries with it. Someone needs to make a special conda package. There have been a few attempts, but I'm not sure it's been done yet. |
I tried on Miniconda (on my CentOS server) and it seems to work: Output
The only difference here is that I compiled libvips without using |
If I'm using an older pip version, don't know if that's changing something. clone from git, check that all modules are present:
build from source :
Since there was no build_ext, it makes sense that this build is an ABI build. |
You could try instructing distutils to build the extension (if you have cloned pyvips):
It will just ouput Output
You can also try this test program: import pkgconfig
# we must have the vips package to be able to do anything
if not pkgconfig.exists('vips'):
raise Exception('unable to find pkg-config package "vips"')
if pkgconfig.installed('vips', '< 8.2'):
raise Exception('pkg-config "vips" is too old -- need libvips 8.2 or later') This will check if the Python module for the It will throw errors when it can not find libvips, for example: Output
|
Still no change. Check build deps
Build
Did we succeed ?
|
It seems that it is not a The API mode requires a working C compiler plus all libvips headers. We could check if the C compiler is working by executing Output
@jcupitt Maybe we should give some details when it falls back to ABI mode during installation? For example (untested): --- a/setup.py
+++ b/setup.py
@@ -115,5 +115,6 @@ def setup_ABI():
try:
setup_API()
-except Exception:
+except Exception as e:
+ print('Falling back to ABI mode. Details: {0}'.format(e))
setup_ABI() |
I'm not sure why it can't find the library : can't find libvips
but libvips.so.42 is present
linking info if needed
|
Here's the salient part of the log:
So it can find libvips but could not load it. It looks like libvips is compiled with giflib 5.x. but is linked against the system giflib ( |
I think this can be fixed with |
Apologies, that was my mistake. Now it finds the library but doesn't build in API mode : Build info
|
Looks like it has successfully built the extension! You can safely ignore those incompatible pointer type warnings, see: #47 (comment). You could try to install pyvips by using pip:
or
Hopefully it will now install the API mode because there were no problems during the compilation of the extension. |
It will print |
I've just tried the proposed patch: Output
So |
But won't you get that message every time you import pyvips? |
Uninstalled the pip installed package and built from source in API mode. Thanks a lot for all the help @kleisauke ! |
It's during the installation so it will be OK ( --- a/setup.py
+++ b/setup.py
@@ -11,6 +11,7 @@ from codecs import open
from os import path
from setuptools import setup, find_packages
+from distutils import log
here = path.abspath(path.dirname(__file__))
@@ -115,5 +116,6 @@ def setup_ABI():
try:
setup_API()
-except Exception:
+except Exception as e:
+ log.warn('Falling back to ABI mode. Details: {0}'.format(e))
setup_ABI() (I used Output of `pip install`
|
Oh, you're right, sorry, I was thinking of the fallback code in Is it OK to mix setuptools and distutils like that? Another option might be to have a post-install hook in the ABI case that displays a message, eg. |
I think it will be OK, I've seen the same thing in source code at cffi. See:
This may also be a good option. As long as we keep the user informed, I think it's good. :) |
2.1.13 includes this extra information. |
Is there an argument I can pass to pyvips to find a local install of libvips ?
The text was updated successfully, but these errors were encountered: