It's not due to this ticket (nothing to do with pagerank) but to #27480 which adds pagerank. We forgot to tag doctests as # optional - python_igraph, and I believe it's too late so we must wait for next beta, right ?

Well, let's do a follow up ticket since this is getting merged properly right now. Please refrain to introduce anymore call to is_package_installed, especially when checking for a python package. There is a proper python way to do this, like in the other sections of code using igraph- from sage/graphs/digraph.py line 693 onward

try:
import igraph
except ImportError:
raise ImportError(...)

replacing the ImportError(...) with PackageNotFoundError is acceptable.

is_package_installed is a big problem for sage-on-distro and it is a filthy quick and dirty hack that shouldn't ever have been included.

It is already on its way out. The only place it is not replaced by feature or something else at runtime is in sage/databases/cremona.py and there is a ticket for that.

It is currently impossible to totally remove it. doctesting with --option=all relies on it (or other features of packages.py which is just as bad) :( and building with some optional package still depends on it look in sage_setup/optional_extension.py . In both case replacement are not easy.