IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
226 stars 118 forks source link

Python 3.8 install #374

Closed znicholls closed 4 years ago

znicholls commented 4 years ago

Matplotlib 3.0.2 was released before matplotlib were packaging Python 3.8 wheels. As a result, it's not trivial to pip install pyam in a Python 3.8 environment. Is it possible to remove this matplotlib pinning and hence support (one-line installs with) Python 3.8?

$ pip install 'pyam-iamc==0.5.0'
Collecting pyam-iamc==0.5.0
  Using cached pyam_iamc-0.5.0-py2.py3-none-any.whl (65 kB)
Collecting seaborn
  Using cached seaborn-0.10.1-py3-none-any.whl (215 kB)
Collecting xlsxwriter
  Using cached XlsxWriter-1.2.8-py2.py3-none-any.whl (141 kB)
Collecting numpy
  Downloading numpy-1.18.4-cp38-cp38-macosx_10_9_x86_64.whl (15.2 MB)
     |████████████████████████████████| 15.2 MB 2.7 MB/s 
Collecting requests
  Using cached requests-2.23.0-py2.py3-none-any.whl (58 kB)
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting PyYAML
  Using cached PyYAML-5.3.1.tar.gz (269 kB)
Collecting xlrd
  Using cached xlrd-1.2.0-py2.py3-none-any.whl (103 kB)
Collecting six
  Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting pandas>=0.25.0
  Downloading pandas-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl (10.2 MB)
     |████████████████████████████████| 10.2 MB 2.0 MB/s 
Collecting matplotlib<=3.0.2
  Downloading matplotlib-3.0.2.tar.gz (36.5 MB)
     |████████████████████████████████| 36.5 MB 143 kB/s 
    ERROR: Command errored out with exit status 1:
     command: /Users/znicholls/miniconda3/envs/py38/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tw/c4s_0zhd4f99j57w6b9hh9p5bjhl58/T/pip-install-fji9o3fo/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/tw/c4s_0zhd4f99j57w6b9hh9p5bjhl58/T/pip-install-fji9o3fo/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 /private/var/folders/tw/c4s_0zhd4f99j57w6b9hh9p5bjhl58/T/pip-pip-egg-info-g2fdudps
         cwd: /private/var/folders/tw/c4s_0zhd4f99j57w6b9hh9p5bjhl58/T/pip-install-fji9o3fo/matplotlib/
    Complete output (46 lines):
    IMPORTANT WARNING:
        pkg-config is not installed.
        matplotlib may not be able to find some of its dependencies
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [3.0.2]
                    python: yes [3.8.2 | packaged by conda-forge | (default, Apr
                            24 2020, 07:56:27)  [Clang 9.0.1 ]]
                  platform: yes [darwin]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [not found. pip may install it below.]
          install_requires: yes [handled by setuptools]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                            could not be found.  You may need to install the
                            development package.]
                       png: yes [version 1.6.37]
                     qhull: yes [pkg-config information for 'libqhull' could not
                            be found. Using local copy.]

    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: no  [skipping due to configuration]
            toolkits_tests: no  [skipping due to configuration]

    OPTIONAL BACKEND EXTENSIONS
                       agg: yes [installing]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                    macosx: yes [installing, darwin]
                 windowing: no  [Microsoft Windows only]

    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]

    ============================================================================
                            * The following required packages can not be built:
                            * freetype
                            * Try installing freetype with `brew install
                            * freetype` and pkg-config with `brew install pkg-
                            * config`
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
znicholls commented 4 years ago

@gidden and @danielhuppmann maybe one for you as the plotting/packaging experts?

danielhuppmann commented 4 years ago

Unfortunately, some features of the plotting library use matplotlib internals, so just removing the pin won't work, see related issues #266, #281, #296, #327.

@gidden, any chance that you look into this?

gidden commented 4 years ago

I agree with the comments that we should allow builds against the latest MPL. I can try to get to that, but am not sure exactly when it would happen.

My suggestion is that we would do the following:

Thoughts?

On Mon, May 11, 2020 at 7:33 AM Daniel Huppmann notifications@github.com wrote:

Unfortunately, some features of the plotting library use matplotlib internals, so just removing the pin won't work, see related issues #266 https://github.com/IAMconsortium/pyam/issues/266, #281 https://github.com/IAMconsortium/pyam/issues/281, #296 https://github.com/IAMconsortium/pyam/issues/296, #327 https://github.com/IAMconsortium/pyam/issues/327.

@gidden https://github.com/gidden, any chance that you look into this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IAMconsortium/pyam/issues/374#issuecomment-626479254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKUAEJPSHIWDOLK6HIBWV3RQ6EZHANCNFSM4M5OBVRQ .

danielhuppmann commented 4 years ago

Not sure if I fully get this suggestion - wouldn't that mean that using a "standard-install" to do plots would fail (raise errors)? Don't think that this is a decent user experience...