--- a/scalene/scalene_gpu.py
+++ b/scalene/scalene_gpu.py
@@ -2,8 +2,6 @@ import contextlib
 import os
 from typing import Tuple
 
-import pynvml
-
 
 class ScaleneGPU:
     """A wrapper around the nvidia device driver library (pynvml)."""
@@ -14,6 +12,7 @@ class ScaleneGPU:
         self.__pid = os.getpid()
         self.__has_per_pid_accounting = False
         with contextlib.suppress(Exception):
+            import pynvml
             pynvml.nvmlInit()
             # Try to actually get utilization and memory usage.
             # If this fails, we disable GPU profiling.
