Skip to content

Commit f5a9ee4

Browse files
Merge pull request #669 from Axelrod-Python/issue-668
Add warning for matplotlib in virtual env on Mac
2 parents 46ad899 + 59de6e6 commit f5a9ee4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

axelrod/plot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from numpy import arange, median, nan_to_num
2+
import warnings
23

34
matplotlib_installed = True
45
try:
@@ -8,6 +9,12 @@
89
from mpl_toolkits.axes_grid1 import make_axes_locatable
910
except ImportError:
1011
matplotlib_installed = False
12+
except RuntimeError:
13+
matplotlib_installed = False
14+
warnings.warn(
15+
'Matplotlib failed to import and so no plots will be produced. This ' +
16+
'could be caused by using a virtual environment on OSX. See ' +
17+
'http://matplotlib.org/faq/virtualenv_faq.html for details.')
1118

1219

1320
def default_cmap():

0 commit comments

Comments
 (0)