freeze_one Like this: pip freeze | grep freeze_one But safer than string manipulation, like this: from freeze_one import freeze_one print(freeze_one("freeze_one"))