首页 > 代码库 > Ubuntu 16.04 LTS 安装libvips出现”Package vips was not found in the pkg-config search path”

Ubuntu 16.04 LTS 安装libvips出现”Package vips was not found in the pkg-config search path”

使用libvips来操作图像,libvips的部署参考一个Node.js工程:https://github.com/lovell/sharp

在MAC下安装很顺利,到Linux环境下(Ubuntu 16.04 LTS)出现了如下问题:

# pkg-config --cflags vips vips vips vips
Package vips was not found in the pkg-config search path.
Perhaps you should add the directory containing `vips.pc‘
to the PKG_CONFIG_PATH environment variable
No package ‘vips‘ found

首先运行下vips -v看看libvips有没有安装成功,如果安装没问题的话,可能就是PKG_CONFIG_PATH环境变量问题,运行printenv PKG_CONFIG_PATH看看具体路径,在我的电脑里,当时竟然是空,当然会找不到libvips了。

参考了这个问题重新设置了下PKG_CONFIG_PATH,我又加了几个路径,最后:

export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig

Ubuntu 16.04 LTS 安装libvips出现”Package vips was not found in the pkg-config search path”