Is there an import_path environment variable when importing?

No, there’s no environment variable. In general, in order to provide path as the name of the package you have to add the dependent package’s module as an import in your build script.

See points 3) and 5) in Basic Usage section for an example:

Namely, the minimal example would be:

// Declare package dependency called "johny"
const johny_dep = b.dependency("johny", .{
    .target = target,
    .optimize = optimize,
});

// Declare dependency's module with the name from its build script
const johny_mod = johny_dep.module("johny");

// Add dependency module as the root module's import
exe.root_module.addImport("my_johny_import", johny_mod);

Then, in your code you would write:

const johny = @import("my_johny_import");