tvwenger / maxfield

An Ingress Linking and Fielding Strategy Generator
http://www.ingress-maxfield.com/
GNU General Public License v3.0
107 stars 58 forks source link

Old matplotlib version installs incompatible numpy version #28

Closed AGSPhoenix closed 4 years ago

AGSPhoenix commented 5 years ago
(venv) phoenix@debian-maxfield:~/maxfield$ pip install -r requirements.txt
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.
Collecting distribute==0.7.3 (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/5f/ad/1fde06877a8d7d5c9b60eff7de2d452f639916ae1d48f0b8f97bf97e570a/distribute-0.7.3.zip
Collecting matplotlib==1.3.1 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/d4/d0/17f17792a4d50994397052220dbe3ac9850ecbde0297b7572933fa4a5c98/matplotlib-1.3.1.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.3.1]
                    python: yes [2.7.16 (default, Apr  6 2019, 01:42:57)  [GCC
                            8.3.0]]
                  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 22.1.16]
                       png: yes [version 1.6.36]

    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-BpDEhz/matplotlib/setup.py", line 268, in <module>
        **extra_args
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
        replace_conflicting=True,
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
        return cmd.easy_install(req)
      File "/home/phoenix/maxfield/venv/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 "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/home/phoenix/maxfield/venv/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 "/home/phoenix/maxfield/venv/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 "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "/home/phoenix/maxfield/venv/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 "/home/phoenix/maxfield/venv/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 "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-_UMBCn/numpy-1.17.0rc2/setup.py", line 31, in <module>
        try:
    RuntimeError: Python version >= 3.5 required.
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-
(venv) phoenix@debian-maxfield:~/maxfield$ python --version
Python 2.7.16

This is on a fresh Debian Buster system.

Numpy 1.16 is the last to support 2.7, yet this old version of matplotlib tries to install numpy 1.5 or greater, which gets 1.17: https://github.com/matplotlib/matplotlib/blob/v1.3.1/setupext.py#L761

Trying to install 1.8.1 separately before doing the rest of requirements.txt doesn't work either:

(venv) phoenix@debian-maxfield:~/maxfield$ python makePlan.py -n 4 EXAMPLE.portals -d out/ -f output.pkl
numpy.dtype has the wrong size, try recompiling
Traceback (most recent call last):
  File "makePlan.py", line 43, in <module>
    import pandas as pd
  File "/home/phoenix/maxfield/venv/local/lib/python2.7/site-packages/pandas/__init__.py", line 6, in <module>
    from . import hashtable, tslib, lib
  File "numpy.pxd", line 157, in init pandas.hashtable (pandas/hashtable.c:22150)
ValueError: numpy.dtype has the wrong size, try recompiling
(venv) phoenix@debian-maxfield:~/maxfield$

Not really sure how to get this running on modern systems


More broadly, are there any plans to update the codebase to Python 3? EOL for Python 2 is 5 months and change from now, and it shows.

tvwenger commented 5 years ago

Thanks for the timely reminder. I'll try to work on this when I have some free time!

elkuku commented 4 years ago

Well, I just ran into the same issue I guess - with just a small difference in the version number

  File "/tmp/easy_install-YcV1ql/numpy-1.18.0rc1/setup.py", line 31, in <module>        
      try:        
RuntimeError: Python version >= 3.5 required.        
tvwenger commented 4 years ago

Latest version (v4.0) is a complete re-write in Python 3.