Skip to content

Install and verify the environment

Copy page

First separate the system libvips library from the language binding. pyvips and govips commonly require a discoverable system libvips. A prebuilt sharp package may bring a compatible libvips, depending on the platform and installation method.

Ubuntu and Debian systems commonly use the development package:

终端窗口
sudo apt-get update
sudo apt-get install libvips-dev

On macOS with Homebrew:

终端窗口
brew install vips

Check the CLI before adding a binding:

终端窗口
vips --version
vips list classes | head
终端窗口
go mod init example.com/vips-check
go get github.com/davidbyttow/govips/v2/vips

govips uses CGO. If compilation cannot find headers or shared libraries, check pkg-config --modversion vips, the system development package, and the library search path.

终端窗口
pnpm add sharp
node -e "import('sharp').then(({default:s}) => console.log(s.versions))"
终端窗口
python -m pip install pyvips
python -c "import pyvips; print(pyvips.version(0), pyvips.version(1), pyvips.version(2))"