diff --git a/apps/microtvm/arduino/template_project/microtvm_api_server.py b/apps/microtvm/arduino/template_project/microtvm_api_server.py index e6ddab78b26d9..131f92a208298 100644 --- a/apps/microtvm/arduino/template_project/microtvm_api_server.py +++ b/apps/microtvm/arduino/template_project/microtvm_api_server.py @@ -34,8 +34,6 @@ import re from packaging import version -import serial -import serial.tools.list_ports from tvm.micro.project_api import server @@ -486,6 +484,9 @@ def flash(self, options): subprocess.run(upload_cmd, check=True) def open_transport(self, options): + import serial + import serial.tools.list_ports + # Zephyr example doesn't throw an error in this case if self._serial is not None: return