def _load_kernel_modules(self):
        if not path.isdir(self.BASE_DIRECTORY):
            system("modprobe w1-gpio >/dev/null 2>&1")
            system("modprobe w1-therm >/dev/null 2>&1")

        for _ in range(self.RETRY_ATTEMPTS):
            if path.isdir(self.BASE_DIRECTORY):  # w1 therm modules loaded correctly
                break
            sleep(self.RETRY_DELAY_SECONDS)
        else:
            raise KernelModuleLoadError()
Load kernel modules needed by the temperature sensor
dataset/ETHPy150Open timofurrer/w1thermsensor/w1thermsensor/core.py/W1ThermSensor._load_kernel_modules