in fclib/fclib/common/utils.py [0:0]
def module_path(env_name, module_name):
"""Return the path of a module in a conda environment.
Args:
env_name (str): name of the conda environment
module_name (str): name of the package/module
Returns:
str: path of the package/module
"""
system = system_type()
if system == "win":
command = "where " + module_name
else:
command = "which " + module_name
all_paths = subprocess.check_output(command, shell=True)
all_paths = all_paths.decode("utf-8").split("\n")
all_paths = [path for path in all_paths if env_name in path]
module_path = ""
if all_paths:
module_path = all_paths[0]
if system == "win":
# Remove additional char \r
module_path = module_path[:-1]
return module_path