Skip to content

Commit e4ee1f7

Browse files
committed
Fence matplotlib import with try block
1 parent a17ac2d commit e4ee1f7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nipype/pipeline/plugins/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ def create_pyscript(node, updatehash=False, store_exception=True):
109109
# create python script to load and trap exception
110110
cmdstr = """import os
111111
import sys
112-
import matplotlib
113-
matplotlib.use('%s')
112+
try:
113+
import matplotlib
114+
matplotlib.use('%s')
115+
except ImportError:
116+
pass
114117
from nipype import config, logging
115118
from nipype.utils.filemanip import loadpkl, savepkl
116119
from socket import gethostname

0 commit comments

Comments
 (0)