From 93aebe4216b50e9f7b290485b296f974ec7916af Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 22 May 2019 22:43:23 +0200 Subject: [PATCH] Avoid setuptools install time error --- moulinette/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/moulinette/core.py b/moulinette/core.py index c438a6c7..a1032bda 100644 --- a/moulinette/core.py +++ b/moulinette/core.py @@ -4,7 +4,6 @@ import os import time import json import logging -import psutil from importlib import import_module @@ -525,6 +524,10 @@ class MoulinetteLock(object): return lock_pids def _is_son_of(self, lock_pids): + # in order to avoid a setuptools installation issue which fails at + # installation time, we only import psutil when appropriate and not + # globally at the module level + import psutil if lock_pids == []: return False