Matplotlib error in importing
I have the exact same problem. I'm not sure what the issue is but every once in a while, when trying to import matplotlib inside ipython I encounter this error and restarting the computer solves the issue. Maybe that would help in locating the issue?
I am using OSX El Capitan and trying to import matplotlib.pyplot
when I do that I get recursive error and at the end it says "ValueError: insecure string pickle"
Here is the whole log:

--------------------------------------------------------------------------- ValueError                                Traceback (most recent call
  last)  in ()
        4 stats = Statistics("HumanData.xlsx")
        5 
  ----> 6 get_ipython().magic(u'matplotlib inline')
        7 
        8 #matplotlib.pyplot.hist(stats.getActionData("Human", "Pacman", "Left"))
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
  in magic(self, arg_s)    2334         magic_name, _, magic_arg_s =
  arg_s.partition(' ')    2335         magic_name =
  magic_name.lstrip(prefilter.ESC_MAGIC)
  -> 2336         return self.run_line_magic(magic_name, magic_arg_s)    2337     2338    
-------------------------------------------------------------------------
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
  in run_line_magic(self, magic_name, line)    2255
  kwargs['local_ns'] = sys._getframe(stack_depth).f_locals    2256
  with self.builtin_trap:
  -> 2257                 result = fn(*args,**kwargs)    2258             return result    2259 
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/IPython/core/magics/pylab.pyc
  in matplotlib(self, line)
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/IPython/core/magic.pyc
  in (f, *a, **k)
      191     # but it's overkill for just that one bit of state.
      192     def magic_deco(arg):
  --> 193         call = lambda f, *a, **k: f(*a, **k)
      194 
      195         if callable(arg):
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/IPython/core/magics/pylab.pyc
  in matplotlib(self, line)
       98             print("Available matplotlib backends: %s" % backends_list)
       99         else:
  --> 100             gui, backend = self.shell.enable_matplotlib(args.gui)
      101             self._show_matplotlib_backend(args.gui, backend)
      102 
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc
  in enable_matplotlib(self, gui)    3130                 gui, backend =
  pt.find_gui_and_backend(self.pylab_gui_select)    3131 
  -> 3132         pt.activate_matplotlib(backend)    3133         pt.configure_inline_support(self, backend)    3134 
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/IPython/core/pylabtools.pyc
  in activate_matplotlib(backend)
      272     matplotlib.rcParams['backend'] = backend
      273 
  --> 274     import matplotlib.pyplot
      275     matplotlib.pyplot.switch_backend(backend)
      276 
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py
  in ()
       27 from cycler import cycler
       28 import matplotlib
  ---> 29 import matplotlib.colorbar
       30 from matplotlib import style
       31 from matplotlib import _pylab_helpers, interactive
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/colorbar.py
  in ()
       32 import matplotlib.artist as martist
       33 import matplotlib.cbook as cbook
  ---> 34 import matplotlib.collections as collections
       35 import matplotlib.colors as colors
       36 import matplotlib.contour as contour
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/collections.py
  in ()
       25 import matplotlib.artist as artist
       26 from matplotlib.artist import allow_rasterization
  ---> 27 import matplotlib.backend_bases as backend_bases
       28 import matplotlib.path as mpath
       29 from matplotlib import _path
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/backend_bases.py
  in ()
       60 
       61 import matplotlib.tight_bbox as tight_bbox
  ---> 62 import matplotlib.textpath as textpath
       63 from matplotlib.path import Path
       64 from matplotlib.cbook import mplDeprecation, warn_deprecated
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/textpath.py
  in ()
       13 from matplotlib.path import Path
       14 from matplotlib import rcParams
  ---> 15 import matplotlib.font_manager as font_manager
       16 from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING
       17 from matplotlib.ft2font import LOAD_TARGET_LIGHT
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py
  in ()    1418                 verbose.report("Using
  fontManager instance from %s" % _fmcache)    1419         except:
  -> 1420             _rebuild()    1421     else:    1422         _rebuild()
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py
  in _rebuild()    1403     def _rebuild():    1404         global
  fontManager
  -> 1405         fontManager = FontManager()    1406         if _fmcache:    1407             pickle_dump(fontManager, _fmcache)
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py
  in init(self, size, weight)    1041         #  Load TrueType fonts
  and create font dictionary.    1042 
  -> 1043         self.ttffiles = findSystemFonts(paths) + findSystemFonts()    1044         self.defaultFamily = {    1045
  'ttf': 'Bitstream Vera Sans',
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py
  in findSystemFonts(fontpaths, fontext)
      321                     fontfiles[f] = 1
      322 
  --> 323             for f in get_fontconfig_fonts(fontext):
      324                 fontfiles[f] = 1
      325 
/Users/AhmedKhalifa/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py
  in get_fontconfig_fonts(fontext)
      273         pipe = subprocess.Popen(['fc-list', '--format=%{file}\n'],
      274                                 stdout=subprocess.PIPE,
  --> 275                                 stderr=subprocess.PIPE)
      276         output = pipe.communicate()[0]
      277     except (OSError, IOError):
/Users/AhmedKhalifa/anaconda/lib/python2.7/subprocess.pyc in
  init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines,
  startupinfo, creationflags)
      708                                 p2cread, p2cwrite,
      709                                 c2pread, c2pwrite,
  --> 710                                 errread, errwrite)
      711         except Exception:
      712             # Preserve original exception in case os.close raises.
/Users/AhmedKhalifa/anaconda/lib/python2.7/subprocess.pyc in
  _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close,
  p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)    1332
  if e.errno != errno.ECHILD:    1333                         raise
  -> 1334                 child_exception = pickle.loads(data)    1335                 raise child_exception    1336 
/Users/AhmedKhalifa/anaconda/lib/python2.7/pickle.pyc in loads(str)
  1386 def loads(str):    1387     file = StringIO(str)
  -> 1388     return Unpickler(file).load()    1389     1390 # Doctest
/Users/AhmedKhalifa/anaconda/lib/python2.7/pickle.pyc in load(self)
      862             while 1:
      863                 key = read(1)
  --> 864                 dispatchkey
      865         except _Stop, stopinst:
      866             return stopinst.value
/Users/AhmedKhalifa/anaconda/lib/python2.7/pickle.pyc in
  load_string(self)
      970             if rep.startswith(q):
      971                 if len(rep) < 2 or not rep.endswith(q):
  --> 972                     raise ValueError, "insecure string pickle"
      973                 rep = rep[len(q):-len(q)]
      974                 break
ValueError: insecure string pickle

Any help with that?