summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--dot_ipython/profile_default/startup/20_logging.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/dot_ipython/profile_default/startup/20_logging.py b/dot_ipython/profile_default/startup/20_logging.py
index 86ef226..75a89b1 100644
--- a/dot_ipython/profile_default/startup/20_logging.py
+++ b/dot_ipython/profile_default/startup/20_logging.py
@@ -6,9 +6,15 @@ import logging
 def _setup() -> logging.Logger:
     import logging
     import os
-    import setuptools
     import glob
 
+    try:
+        import setuptools
+    except ModuleNotFoundError:
+        found_packages = []
+    else:
+        found_packages = setuptools.find_packages()
+
     # Determine log levels
     project_level = getattr(logging, os.environ.get("LOG_LEVEL", "INFO"))
     root_level = getattr(logging, os.environ.get("ROOT_LOG_LEVEL", "WARNING"))
@@ -18,7 +24,7 @@ def _setup() -> logging.Logger:
     project_names = (
         ["__main__", "repl"]
         + [x[:-3] for x in glob.glob("*.py")]
-        + setuptools.find_packages()
+        + found_packages
     )
 
     # Set logging levels