Issue 1:
Something has changed in numpy.distutils that is causing matplotlib to not build.

I've tried git bisecting, but the history seems a little convoluted and it isn't helping to find the issue.

Traceback (most recent call last):
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 152, in save_modules
yield saved
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 237, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 267, in run
return func()
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 236, in runner
_execfile(setup_script, ns)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-ywbtwurq/numpy-1.10.1/setup.py", line 264, in <module>
if isinstance(package, str):
File "/tmp/easy_install-ywbtwurq/numpy-1.10.1/setup.py", line 256, in setup_package
# Go through all of the packages and figure out which ones we are
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/core.py", line 135, in setup
config = configuration()
File "/tmp/easy_install-ywbtwurq/numpy-1.10.1/setup.py", line 156, in configuration

File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 1001, in add_subpackage
caller_level = 2)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 970, in get_subpackage
caller_level = caller_level + 1)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 907, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "numpy/setup.py", line 11, in configuration
from setuptools.command.test import test as TestCommand
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 1001, in add_subpackage
caller_level = 2)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 970, in get_subpackage
caller_level = caller_level + 1)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 882, in _get_configuration_from_setup_py
('.py', 'U', 1))
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "numpy/core/setup.py", line 13, in <module>
import sys
ImportError: No module named 'numpy._build_utils'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 381, in <module>
**extra_args
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/dist.py", line 268, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pkg_resources/__init__.py", line 836, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1081, in best_match
return self.obtain(req, installer)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1093, in obtain
return installer(requirement)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
return cmd.easy_install(req)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 629, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 659, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 842, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1070, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1056, in run_setup
run_setup(setup_script, args)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 240, in run_setup
raise
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 164, in save_modules
saved_exc.resume()
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 139, in resume
compat.reraise(type, exc, self._tb)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/compat.py", line 65, in reraise
raise value.with_traceback(tb)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 152, in save_modules
yield saved
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 237, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 267, in run
return func()
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 236, in runner
_execfile(setup_script, ns)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-ywbtwurq/numpy-1.10.1/setup.py", line 264, in <module>
if isinstance(package, str):
File "/tmp/easy_install-ywbtwurq/numpy-1.10.1/setup.py", line 256, in setup_package
# Go through all of the packages and figure out which ones we are
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/core.py", line 135, in setup
config = configuration()
File "/tmp/easy_install-ywbtwurq/numpy-1.10.1/setup.py", line 156, in configuration

File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 1001, in add_subpackage
caller_level = 2)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 970, in get_subpackage
caller_level = caller_level + 1)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 907, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "numpy/setup.py", line 11, in configuration
from setuptools.command.test import test as TestCommand
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 1001, in add_subpackage
caller_level = 2)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 970, in get_subpackage
caller_level = caller_level + 1)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/site-packages/numpy/distutils/misc_util.py", line 882, in _get_configuration_from_setup_py
('.py', 'U', 1))
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/home/mdboom/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "numpy/core/setup.py", line 13, in <module>
import sys
ImportError: No module named 'numpy._build_utils'

Issue 2:
NumPy prefers using distutils to setuptools for the install step and thus creation of the egg-info filename. This means that the egg-info filename gets the + in the version replaced with _ and written out as numpy-1.11.0.dev0_2329eae.egg-info, despite the fact that the version is numpy-1.11.0.dev0+2329eae.

This causes a problem for satisfying requirements for other packages, since setuptools sees this as a LegacyVersion (after replacing the _ with a - in the filename), and thus you can get errors like this:

pkg_resources.VersionConflict: (numpy 1.11.0.dev0-2329eae (/home/larsoner/.local/lib/python2.7/site-packages), Requirement.parse('numpy>=1.6.1'))

One solution that might work is using setuptools for the install step, because setuptools creates the name with the + in it and it thus gets parsed properly. However, given the lengths taken to triage distutils vs setuptools in that step, I assume there is a reason why distutils is preferred. And it looks like back in 2013 this was addressed:

scipy/scipy@a4e93fb#diff-2eeaed663bd0d25b7e608891384b7298L185

Maybe setuptools would be okay to use now...?

Related setuptools ticket:

https://bitbucket.org/pypa/setuptools/issues/419/setuptools-pkg_resources-fails-to-detect

Any ideas for how to solve this problem?