Skip to content

BUG: matplotlib is supposed to be optional #1003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Next release
============

* BUG: matplotlib is supposed to be optional (https://github.com/nipy/nipype/pull/1003)
* FIX: Fix split_filename behaviour when path has no file component (https://github.com/nipy/nipype/pull/1035)
* ENH: Updated FSL dtifit to include option for grad non-linearities (https://github.com/nipy/nipype/pull/1032)
* ENH: Updated Camino tracking interfaces, which can now use FSL bedpostx output.
Expand Down
8 changes: 7 additions & 1 deletion nipype/pipeline/plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ def create_pyscript(node, updatehash=False, store_exception=True):
# create python script to load and trap exception
cmdstr = """import os
import sys

can_import_matplotlib = True #Silently allow matplotlib to be ignored
try:
import matplotlib
matplotlib.use('%s')
except ImportError:
can_import_matplotlib = False
pass

from nipype import config, logging
from nipype.utils.filemanip import loadpkl, savepkl
from socket import gethostname
Expand All @@ -130,7 +134,9 @@ def create_pyscript(node, updatehash=False, store_exception=True):
from collections import OrderedDict
config_dict=%s
config.update_config(config_dict)
config.update_matplotlib()
## Only configure matplotlib if it was successfully imported, matplotlib is an optional component to nipype
if can_import_matplotlib:
config.update_matplotlib()
logging.update_logging(config)
traceback=None
cwd = os.getcwd()
Expand Down