Hawthorn.master native build breaks: RuntimeError: Python version >= 3.5 required

Moving this conversation over from Slack.

the matplotlib requirement in /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt is somehow causing one of its requirements – numpy – to install itself as version 1.7.x rather than 1.6.2, the later version of which requires Python >= 3.5. Ansible fails at step, “TASK [edxapp : code sandbox | Install base sandbox requirements and create sandbox virtualenv]”. The stack trace follows.

exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-MD_1sB/matplotlib

============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [1.3.1]
                python: yes [2.7.12 (default, Nov 12 2018, 14:36:49)  [GCC
                        5.4.0 20160609]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [not found. pip may install it below.]
              dateutil: yes [dateutil was not found. It is required for date
                        axis support. pip/easy_install may attempt to
                        install it after matplotlib.]
               tornado: yes [tornado was not found. It is required for the
                        WebAgg backend. pip/easy_install may attempt to
                        install it after matplotlib.]
             pyparsing: yes [pyparsing was not found. It is required for
                        mathtext support. pip/easy_install may attempt to
                        install it after matplotlib.]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: yes [version 18.1.12]
                   png: yes [version 1.2.54]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: yes [nose 0.11.1 or later is required to run the
                        matplotlib test suite]

OPTIONAL BACKEND EXTENSIONS
                macosx: no  [Mac OS-X only]
                qt4agg: no  [PyQt4 not found]
               gtk3agg: no  [Requires pygobject to be installed.]
             gtk3cairo: no  [Requires cairo to be installed.]
                gtkagg: no  [Requires pygtk]
                 tkagg: no  [TKAgg requires Tkinter.]
                 wxagg: no  [requires wxPython]
                   gtk: no  [Requires pygtk]
                   agg: yes [installing]
                 cairo: no  [cairo not found]
             windowing: no  [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES
                dvipng: no
           ghostscript: no
                 latex: no
               pdftops: no

Traceback (most recent call last):
  File \"<string>\", line 1, in <module>
  File \"/tmp/pip-install-MD_1sB/matplotlib/setup.py\", line 268, in <module>
    **extra_args
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/__init__.py\", line 144, in setup
    _install_setup_requires(attrs)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/__init__.py\", line 139, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/dist.py\", line 717, in fetch_build_eggs
    replace_conflicting=True,
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 782, in resolve
    replace_conflicting=replace_conflicting
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 1065, in best_match
    return self.obtain(req, installer)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 1077, in obtain
    return installer(requirement)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/dist.py\", line 784, in fetch_build_egg
    return cmd.easy_install(req)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 679, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 705, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 890, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 1158, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 1144, in run_setup
    run_setup(setup_script, args)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 253, in run_setup
    raise
  File \"/usr/lib/python2.7/contextlib.py\", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 195, in setup_context
    yield
  File \"/usr/lib/python2.7/contextlib.py\", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 166, in save_modules
    saved_exc.resume()
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 141, in resume
    six.reraise(type, exc, self._tb)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 154, in save_modules
    yield saved
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 195, in setup_context
    yield
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 250, in run_setup
    _execfile(setup_script, ns)
  File \"/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 45, in _execfile
    exec(code, globals, locals)
  File \"/tmp/easy_install-JreA1F/numpy-1.17.0rc2/setup.py\", line 31, in <module>
    try:
RuntimeError: Python version >= 3.5 required.
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
"}

I’m encountering the same issue on Ironwood.2 and Ironwood.1
This is my first attempt at installing OpenEdx and I’m not sure if I’m doing something wrong.

stdout: Looking in indexes: https://pypi.python.org/simple
Processing ./common/lib/calc
Processing ./common/lib/chem
Processing ./common/lib/sandbox-packages
Processing ./common/lib/symmath
Collecting asn1crypto==0.24.0 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 11))
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting backports-abc==0.5 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 12))
Using cached https://files.pythonhosted.org/packages/7d/56/6f3ac1b816d0cd8994e83d0c4e55bc64567532f7dc543378bd87f81cebc7/backports_abc-0.5-py2.py3-none-any.whl
Collecting cffi==1.11.5 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 13))
Using cached https://files.pythonhosted.org/packages/14/dd/3e7a1e1280e7d767bd3fa15791759c91ec19058ebe31217fe66f3e9a8c49/cffi-1.11.5-cp27-cp27mu-manylinux1_x86_64.whl
Collecting cryptography==2.4.2 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 14))
Using cached https://files.pythonhosted.org/packages/7f/ba/383b51cc26e3141c689ce988814385c7659f5ba01c4b5f2de38233010b5f/cryptography-2.4.2-cp27-cp27mu-manylinux1_x86_64.whl
Collecting enum34==1.1.6 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 15))
Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting futures==3.2.0 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 16))
Using cached https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
Collecting idna==2.8 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 17))
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting ipaddress==1.0.22 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 18))
Using cached https://files.pythonhosted.org/packages/fc/d0/7fc3a811e011d4b388be48a0e381db8d990042df54aa4ef4599a31d39853/ipaddress-1.0.22-py2.py3-none-any.whl
Collecting lxml==3.8.0 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 19))
Using cached https://files.pythonhosted.org/packages/1b/e8/ce25c547daf9b84cafea605eb8a5709524fb53e1b3bb5ef6884e561b9d34/lxml-3.8.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting markupsafe==1.1.0 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 20))
Using cached https://files.pythonhosted.org/packages/bc/3a/6bfd7b4b202fa33bdda8e4e3d3acc719f381fd730f9a0e7c5f34e845bd4d/MarkupSafe-1.1.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting matplotlib==1.3.1 (from -r /edx/app/edxapp/edx-platform/requirements/edx-sandbox/base.txt (line 21))
Using cached https://files.pythonhosted.org/packages/d4/d0/17f17792a4d50994397052220dbe3ac9850ecbde0297b7572933fa4a5c98/matplotlib-1.3.1.tar.gz

:stderr: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More de
tails about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    ERROR: Command errored out with exit status 1:
    command: /edx/app/edxapp/venvs/edxapp-sandbox/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ALPaZI/matplotlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ALPaZI/matplotlib/setup.py'"'
"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
        cwd: /tmp/pip-install-ALPaZI/matplotlib/
    Complete output (102 lines):
    ============================================================================
    Edit setup.cfg to change the build options
    
    BUILDING MATPLOTLIB
                matplotlib: yes [1.3.1]
                    python: yes [2.7.12 (default, Nov 12 2018, 14:36:49)  [GCC
                            5.4.0 20160609]]
                platform: yes [linux2]
    
    REQUIRED DEPENDENCIES AND EXTENSIONS
                    numpy: yes [not found. pip may install it below.]
                dateutil: yes [dateutil was not found. It is required for date
                            axis support. pip/easy_install may attempt to
                            install it after matplotlib.]
                tornado: yes [tornado was not found. It is required for the
                            WebAgg backend. pip/easy_install may attempt to
                            install it after matplotlib.]
                pyparsing: yes [pyparsing was not found. It is required for
                            mathtext support. pip/easy_install may attempt to
                            install it after matplotlib.]
                    pycxx: yes [Couldn't import.  Using local copy.]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                freetype: yes [version 18.1.12]
                    png: yes [version 1.2.54]
    
    OPTIONAL SUBPACKAGES
            sample_data: yes [installing]
                toolkits: yes [installing]
                    tests: yes [nose 0.11.1 or later is required to run the
                            matplotlib test suite]
    
    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [Mac OS-X only]
                    qt4agg: no  [PyQt4 not found]
                gtk3agg: no  [Requires pygobject to be installed.]
                gtk3cairo: no  [Requires cairo to be installed.]
                    gtkagg: no  [Requires pygtk]
                    tkagg: no  [TKAgg requires Tkinter.]
                    wxagg: no  [requires wxPython]
                    gtk: no  [Requires pygtk]
                    agg: yes [installing]
                    cairo: no  [cairo not found]
                windowing: no  [Microsoft Windows only]
    
    OPTIONAL LATEX DEPENDENCIES
                    dvipng: no
            ghostscript: no
                    latex: no
                pdftops: no
    
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-ALPaZI/matplotlib/setup.py", line 268, in <module>
        **extra_args
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
        raise
    File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
    File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
    File "/edx/app/edxapp/venvs/edxapp-sandbox/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
    File "/tmp/easy_install-K4DzlF/numpy-1.17.0/setup.py", line 31, in <module>
        try:
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

This problem is fixed on ironwood.master.