Class 'Imagick' not found

I’m trying to use Imagick, but I get this error: Class ‘Imagick’ not found. Should something else be installed in addition to the Basic Cakephp?

The code is simple:

$im = new Imagick($filepath);
$max = $im->getNumberImages();

Do you have php-imagick installed?

I installed calcinai/php-imagick

Where are you executing the code?

maybe calling

use \Imagick;

// ...

$im = new Imagick($filepath);