Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Cannot install Matplotlib from Git in MacOS Ventura (likely related to Matplotlib-own-FreeType) #25051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuzie007 opened this issue Jan 21, 2023 · 1 comment

Comments

@yuzie007
Copy link
Contributor

Bug summary

For development purposes, I forked and cloned Matploltlib from this Github repository and tried to install using pip in the development mode (-e), but I got the following error.

  • I use MacOS Ventura (Darwin 22.2.0) with Apple-Silicon (M1)
  • The error occurred at the installation of Matplotlib-owned freetype
  • I could install Matplotlib using system-installed freetype using setup.cfg below, so likely the issue is related to Matplotlib-owned freetype.
[libs]
system_freetype = true
  • The key of the error seems to be the following part:
    cd builds/unix; \
    	        ./configure  '--with-zlib=no' '--with-bzip2=no' '--with-png=no' '--with-harfbuzz=no' '--enable-static' '--disable-shared' '--host=arm64-apple-darwin20.0.0'
    checking build system type... arm-apple-darwin22.2.0
    checking host system type... Invalid configuration `arm64-apple-darwin20.0.0': machine `arm64-apple' not recognized
    configure: error: /bin/sh ./config.sub arm64-apple-darwin20.0.0 failed

A possible reason may be either

  • Matplotlib-owned freetype (2.6.1) does not support Apple-Silicon MacOS (True?), or
  • It does support non-latest Apple-Silicon MacOS, but not yet the latest Ventura?

One thing I am wondering is why '--host=arm64-apple-darwin20.0.0' is given in ./configure although my Darwin is 22.2.0.

Thank you very much developers for your help in advance.

Code for reproduction

pip install -e .

Actual outcome

Obtaining file:///Users/ikeda/codes/matplotlib
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: setuptools-scm>=7 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (7.1.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (1.4.4)
Requirement already satisfied: packaging>=20.0 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (23.0)
Requirement already satisfied: pyparsing>=2.3.1 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (3.0.9)
Requirement already satisfied: importlib-resources>=3.2.0 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (5.10.2)
Requirement already satisfied: python-dateutil>=2.7 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (2.8.2)
Requirement already satisfied: pillow>=6.2.0 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (9.4.0)
Requirement already satisfied: contourpy>=1.0.1 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (1.0.7)
Requirement already satisfied: numpy>=1.21 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (1.24.1)
Requirement already satisfied: fonttools>=4.22.0 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (4.38.0)
Requirement already satisfied: cycler>=0.10 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from matplotlib==0.1.0.dev45646+gcb06554) (0.11.0)
Requirement already satisfied: zipp>=3.1.0 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from importlib-resources>=3.2.0->matplotlib==0.1.0.dev45646+gcb06554) (3.11.0)
Requirement already satisfied: six>=1.5 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib==0.1.0.dev45646+gcb06554) (1.16.0)
Requirement already satisfied: setuptools in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from setuptools-scm>=7->matplotlib==0.1.0.dev45646+gcb06554) (61.2.0)
Requirement already satisfied: typing-extensions in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from setuptools-scm>=7->matplotlib==0.1.0.dev45646+gcb06554) (4.4.0)
Requirement already satisfied: tomli>=1.0.0 in /Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/site-packages (from setuptools-scm>=7->matplotlib==0.1.0.dev45646+gcb06554) (2.0.1)
Installing collected packages: matplotlib
  Running setup.py develop for matplotlib
    ERROR: Command errored out with exit status 1:
     command: /Users/ikeda/miniconda3/envs/matplotlib-dev/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/ikeda/codes/matplotlib/setup.py'"'"'; __file__='"'"'/Users/ikeda/codes/matplotlib/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /Users/ikeda/codes/matplotlib/
    Complete output (99 lines):
    /private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/dist.py:285: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420).
      warnings.warn(msg, SetuptoolsDeprecationWarning)

    Edit mplsetup.cfg to change the build options; suppress output with --quiet.

    BUILDING MATPLOTLIB
          python: yes [3.9.12 (main, Apr  5 2022, 01:52:34)  [Clang 12.0.0 ]]
        platform: yes [darwin]
           tests: no  [skipping due to configuration]
          macosx: yes [installing]

    running develop
    /private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running egg_info
    writing lib/matplotlib.egg-info/PKG-INFO
    writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt
    writing namespace_packages to lib/matplotlib.egg-info/namespace_packages.txt
    writing requirements to lib/matplotlib.egg-info/requires.txt
    writing top-level names to lib/matplotlib.egg-info/top_level.txt
    adding license file 'LICENSE/LICENSE'
    adding license file 'LICENSE/LICENSE_AMSFONTS'
    adding license file 'LICENSE/LICENSE_BAKOMA'
    adding license file 'LICENSE/LICENSE_CARLOGO'
    adding license file 'LICENSE/LICENSE_COLORBREWER'
    adding license file 'LICENSE/LICENSE_COURIERTEN'
    adding license file 'LICENSE/LICENSE_JSXTOOLS_RESIZE_OBSERVER'
    adding license file 'LICENSE/LICENSE_QHULL'
    adding license file 'LICENSE/LICENSE_QT4_EDITOR'
    adding license file 'LICENSE/LICENSE_SOLARIZED'
    adding license file 'LICENSE/LICENSE_STIX'
    adding license file 'LICENSE/LICENSE_YORICK'
    writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
    running build_ext
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/ikeda/miniconda3/envs/matplotlib-dev/include -arch arm64 -I/Users/ikeda/miniconda3/envs/matplotlib-dev/include -fPIC -O2 -isystem /Users/ikeda/miniconda3/envs/matplotlib-dev/include -arch arm64 -I/Users/ikeda/miniconda3/envs/matplotlib-dev/include/python3.9 -c /var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/tmpguoklkpy.cpp -o var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/tmpguoklkpy.o -fvisibility=hidden
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/ikeda/miniconda3/envs/matplotlib-dev/include -arch arm64 -I/Users/ikeda/miniconda3/envs/matplotlib-dev/include -fPIC -O2 -isystem /Users/ikeda/miniconda3/envs/matplotlib-dev/include -arch arm64 -I/Users/ikeda/miniconda3/envs/matplotlib-dev/include/python3.9 -c /var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/tmpr8z1i6kz.cpp -o var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/tmpr8z1i6kz.o -fvisibility-inlines-hidden
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/ikeda/miniconda3/envs/matplotlib-dev/include -arch arm64 -I/Users/ikeda/miniconda3/envs/matplotlib-dev/include -fPIC -O2 -isystem /Users/ikeda/miniconda3/envs/matplotlib-dev/include -arch arm64 -I/Users/ikeda/miniconda3/envs/matplotlib-dev/include/python3.9 -c /var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/tmpi980u469.cpp -o var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/tmpi980u469.o -flto

    FreeType build system -- automatic system detection

    The following settings are used:

      platform                    unix
      compiler                    clang
      configuration directory     ./builds/unix
      configuration rules         ./builds/unix/unix.mk

    If this does not correspond to your system or settings please remove the file
    `config.mk' from this directory then read the INSTALL file for help.

    Otherwise, simply type `/Applications/Xcode.app/Contents/Developer/usr/bin/make' again to build the library,
    or `/Applications/Xcode.app/Contents/Developer/usr/bin/make refdoc' to build the API reference (this needs python >= 2.6).

    cd builds/unix; \
    	        ./configure  '--with-zlib=no' '--with-bzip2=no' '--with-png=no' '--with-harfbuzz=no' '--enable-static' '--disable-shared' '--host=arm64-apple-darwin20.0.0'
    checking build system type... arm-apple-darwin22.2.0
    checking host system type... Invalid configuration `arm64-apple-darwin20.0.0': machine `arm64-apple' not recognized
    configure: error: /bin/sh ./config.sub arm64-apple-darwin20.0.0 failed
    make: *** [setup] Error 1
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/ikeda/codes/matplotlib/setup.py", line 270, in <module>
        setup(  # Finally, pass this all along to setuptools to do the heavy lifting.
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 108, in setup
        return distutils.core.setup(**attrs)
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
        self.run_command(cmd)
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1213, in run_command
        super().run_command(command)
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development
        self.run_command('build_ext')
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
        self.distribution.run_command(command)
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1213, in run_command
        super().run_command(command)
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
        _build_ext.run(self)
      File "/private/var/folders/t5/tgnxd1t14qzcl85h5c9w8v2r0000gn/T/pip-build-env-1ros0004/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
        self.build_extensions()
      File "/Users/ikeda/codes/matplotlib/setup.py", line 183, in build_extensions
        package.do_custom_build(env)
      File "/Users/ikeda/codes/matplotlib/setupext.py", line 654, in do_custom_build
        subprocess.check_call(configure, env=env, cwd=src_path)
      File "/Users/ikeda/miniconda3/envs/matplotlib-dev/lib/python3.9/subprocess.py", line 373, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['./configure', '--with-zlib=no', '--with-bzip2=no', '--with-png=no', '--with-harfbuzz=no', '--enable-static', '--disable-shared', '--host=arm64-apple-darwin20.0.0']' returned non-zero exit status 2.
    Building freetype in build/freetype-2.6.1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/ikeda/miniconda3/envs/matplotlib-dev/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/ikeda/codes/matplotlib/setup.py'"'"'; __file__='"'"'/Users/ikeda/codes/matplotlib/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Expected outcome

Hopefully, Matplotlib should be able to be installed also in the lastest MacOS Ventura.

Additional information

macOS Ventura 13.1 Apple M1 Pro Darwin 22.2.0 arm

Operating system

OS/X

Matplotlib Version

commit 2403d74

Matplotlib Backend

No response

Python version

Python 3.9.12

Jupyter version

No response

Installation

git checkout

@dstansby
Copy link
Member

I think this is a duplicate of #24168, so I'll close this one. If you have any insight that could help fix this please post on the other issue!

@dstansby dstansby closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants