Skip to content

Basemap install failing issue in MacOS #547

Closed

Description

Hi, I tried to install Basemap via pip in Mac OS, but I have encountered an error.
I also tried with another version (1.3.0), but those resulted in another error related to GEOS (it is installed and the environment variable is set correctly though).

Really appreciate your effort on this outstanding tool and thank you in advance for your support.

following is the log for installation of v 1.3.3:

$pip install basemap
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at Homebrew/homebrew-core#76621
Collecting basemap
Using cached basemap-1.3.3.zip (155 kB)
Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [553 lines of output]
Ignoring numpy: markers 'python_version >= "3.10"' don't match your environment
Ignoring numpy: markers 'python_version == "2.6" or (python_version >= "3.2" and python_version <= "3.3")' don't match your environment
Ignoring cython: markers 'python_version == "3.2"' don't match your environment
Collecting setuptools
Downloading setuptools-63.4.1-py3-none-any.whl (1.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 7.2 MB/s eta 0:00:00
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting numpy==1.16.6
Using cached numpy-1.16.6.zip (5.1 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting cython<3.1,>=0.29
Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
Building wheels for collected packages: numpy
Building wheel for numpy (setup.py): started
Building wheel for numpy (setup.py): finished with status 'error'
error: subprocess-exited-with-error

    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [239 lines of output]
        Running from numpy source directory.
        /private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/misc_util.py:476: SyntaxWarning: "is" with a literal. Did you mean "=="?
          return is_string(s) and ('*' in s or '?' is s)
        blas_opt_info:
        blas_mkl_info:
        customize UnixCCompiler
          libraries mkl_rt not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        blis_info:
        customize UnixCCompiler
          libraries blis not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        openblas_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_3_10_blas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries tatlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_3_10_blas_info:
        customize UnixCCompiler
          libraries satlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_blas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_blas_info:
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        accelerate_info:
          FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

          FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

        /bin/sh: svnversion: command not found
        non-existing path in 'numpy/distutils': 'site.cfg'
        lapack_opt_info:
        lapack_mkl_info:
        customize UnixCCompiler
          libraries mkl_rt not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        openblas_lapack_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        openblas_clapack_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas,lapack not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_3_10_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
          NOT AVAILABLE

        atlas_3_10_info:
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_3_10_info'>
          NOT AVAILABLE

        atlas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_threads_info'>
          NOT AVAILABLE

        atlas_info:
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_info'>
          NOT AVAILABLE

          FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

        /usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
          warnings.warn(msg)
        running bdist_wheel
        running build
        running config_cc
        unifing config_cc, config, build_clib, build_ext, build commands --compiler options
        running config_fc
        unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
        running build_src
        build_src
        building py_modules sources
        creating build
        creating build/src.macosx-12-x86_64-3.9
        creating build/src.macosx-12-x86_64-3.9/numpy
        creating build/src.macosx-12-x86_64-3.9/numpy/distutils
        building library "npymath" sources
        get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
        customize Gnu95FCompiler
        Found executable /usr/local/bin/gfortran
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/setup.py", line 419, in <module>
            setup_package()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/setup.py", line 411, in setup_package
            setup(**metadata)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/core.py", line 171, in setup
            return old_setup(**new_attr)
          File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
            return distutils.core.setup(**attrs)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
            return run_commands(dist)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
            dist.run_commands()
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
            self.run_command(cmd)
          File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
            super().run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/usr/local/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
            self.run_command('build')
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
            super().run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build.py", line 47, in run
            old_build.run(self)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 136, in run
            self.run_command(cmd_name)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
            super().run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 148, in run
            self.build_sources()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 159, in build_sources
            self.build_library_sources(*libname_info)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 292, in build_library_sources
            sources = self.generate_sources(sources, (lib_name, build_info))
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 375, in generate_sources
            source = func(extension, build_dir)
          File "numpy/core/setup.py", line 665, in get_mathlib_info
            st = config_cmd.try_link('int main(void) { return 0;}')
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/config.py", line 241, in try_link
            self._check_compiler()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/config.py", line 80, in _check_compiler
            self.fcompiler = new_fcompiler(compiler=self.fcompiler,
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 884, in new_fcompiler
            compiler = get_default_fcompiler(plat, requiref90=requiref90,
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 855, in get_default_fcompiler
            compiler_type =  _find_existing_fcompiler(matching_compiler_types,
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 806, in _find_existing_fcompiler
            c.customize(dist)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 530, in customize
            linker_so_flags = self.flag_vars.linker_so
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/environment.py", line 40, in __getattr__
            return self._get_var(name, conf_desc)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/environment.py", line 56, in _get_var
            var = self._hook_handler(name, hook)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 709, in _environment_hook
            return hook()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/gnu.py", line 353, in get_flags_linker_so
            flags = GnuFCompiler.get_flags_linker_so(self)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/gnu.py", line 144, in get_flags_linker_so
            os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
          File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 684, in __setitem__
            value = self.encodevalue(value)
          File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 756, in encode
            raise TypeError("str expected, not %s" % type(value).__name__)
        TypeError: str expected, not int
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for numpy
    Running setup.py clean for numpy
    error: subprocess-exited-with-error

    × python setup.py clean did not run successfully.
    │ exit code: 1
    ╰─> [10 lines of output]
        Running from numpy source directory.

        `setup.py clean` is not supported, use one of the following instead:

          - `git clean -xdf` (cleans all files)
          - `git clean -Xdf` (cleans all versioned files, doesn't touch
                              files that aren't checked into the git repo)

        Add `--force` to your command to use it anyway if you must (unsupported).

        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed cleaning build dir for numpy
  Failed to build numpy
  Installing collected packages: wheel, setuptools, numpy, cython
    Running setup.py install for numpy: started
    Running setup.py install for numpy: finished with status 'error'
    error: subprocess-exited-with-error

    × Running setup.py install for numpy did not run successfully.
    │ exit code: 1
    ╰─> [248 lines of output]
        Running from numpy source directory.

        Note: if you need reliable uninstall behavior, then install
        with pip instead of using `setup.py install`:

          - `pip install .`       (from a git repo or downloaded source
                                   release)
          - `pip install numpy`   (last NumPy release on PyPi)


        blas_opt_info:
        blas_mkl_info:
        customize UnixCCompiler
          libraries mkl_rt not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        blis_info:
        customize UnixCCompiler
          libraries blis not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        openblas_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_3_10_blas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries tatlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_3_10_blas_info:
        customize UnixCCompiler
          libraries satlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_blas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_blas_info:
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        accelerate_info:
          FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

          FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

        /bin/sh: svnversion: command not found
        non-existing path in 'numpy/distutils': 'site.cfg'
        lapack_opt_info:
        lapack_mkl_info:
        customize UnixCCompiler
          libraries mkl_rt not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        openblas_lapack_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        openblas_clapack_info:
        customize UnixCCompiler
        customize UnixCCompiler
          libraries openblas,lapack not found in ['/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE

        atlas_3_10_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries tatlas,tatlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
          NOT AVAILABLE

        atlas_3_10_info:
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries satlas,satlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_3_10_info'>
          NOT AVAILABLE

        atlas_threads_info:
        Setting PTATLAS=ATLAS
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_threads_info'>
          NOT AVAILABLE

        atlas_info:
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /usr/local/lib
        customize UnixCCompiler
          libraries lapack_atlas not found in /usr/lib
        customize UnixCCompiler
          libraries f77blas,cblas,atlas not found in /usr/lib
        <class 'numpy.distutils.system_info.atlas_info'>
          NOT AVAILABLE

          FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]

        /usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
          warnings.warn(msg)
        running install
        /usr/local/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 build
        running config_cc
        unifing config_cc, config, build_clib, build_ext, build commands --compiler options
        running config_fc
        unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
        running build_src
        build_src
        building py_modules sources
        building library "npymath" sources
        get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
        customize Gnu95FCompiler
        Found executable /usr/local/bin/gfortran
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/setup.py", line 419, in <module>
            setup_package()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/setup.py", line 411, in setup_package
            setup(**metadata)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/core.py", line 171, in setup
            return old_setup(**new_attr)
          File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
            return distutils.core.setup(**attrs)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
            return run_commands(dist)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
            dist.run_commands()
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
            self.run_command(cmd)
          File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
            super().run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/install.py", line 62, in run
            r = self.setuptools_run()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/install.py", line 36, in setuptools_run
            return distutils_install.run(self)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/install.py", line 670, in run
            self.run_command('build')
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
            super().run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build.py", line 47, in run
            old_build.run(self)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 136, in run
            self.run_command(cmd_name)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1229, in run_command
            super().run_command(command)
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 148, in run
            self.build_sources()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 159, in build_sources
            self.build_library_sources(*libname_info)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 292, in build_library_sources
            sources = self.generate_sources(sources, (lib_name, build_info))
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/build_src.py", line 375, in generate_sources
            source = func(extension, build_dir)
          File "numpy/core/setup.py", line 665, in get_mathlib_info
            st = config_cmd.try_link('int main(void) { return 0;}')
          File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/config.py", line 241, in try_link
            self._check_compiler()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/command/config.py", line 80, in _check_compiler
            self.fcompiler = new_fcompiler(compiler=self.fcompiler,
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 884, in new_fcompiler
            compiler = get_default_fcompiler(plat, requiref90=requiref90,
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 855, in get_default_fcompiler
            compiler_type =  _find_existing_fcompiler(matching_compiler_types,
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 806, in _find_existing_fcompiler
            c.customize(dist)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 530, in customize
            linker_so_flags = self.flag_vars.linker_so
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/environment.py", line 40, in __getattr__
            return self._get_var(name, conf_desc)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/environment.py", line 56, in _get_var
            var = self._hook_handler(name, hook)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/__init__.py", line 709, in _environment_hook
            return hook()
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/gnu.py", line 353, in get_flags_linker_so
            flags = GnuFCompiler.get_flags_linker_so(self)
          File "/private/var/folders/fc/29bg66sx4_x32gn5bfz_0fgh0000gn/T/pip-install-mnxg0uip/numpy_cdaa9579c1e345e6b85c29fc7af2b92d/numpy/distutils/fcompiler/gnu.py", line 144, in get_flags_linker_so
            os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
          File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 684, in __setitem__
            value = self.encodevalue(value)
          File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 756, in encode
            raise TypeError("str expected, not %s" % type(value).__name__)
        TypeError: str expected, not int
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: legacy-install-failure

  × Encountered error while trying to install package.
  ╰─> numpy

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for output from the failure.
  WARNING: There was an error checking the latest version of pip.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: There was an error checking the latest version of pip.

And, following is NumPy info:
$pip show numpy
Name: numpy
Version: 1.23.1
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email:
License: BSD
Location: /usr/local/lib/python3.9/site-packages
Requires:
Required-by: cftime, h5py, matplotlib, netCDF4, pandas, ray, scipy, wradlib, xarray

Next is pip, and python versions:
$pip -V
pip 22.1.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)

Activity

  1. molinav commented on Aug 6, 2022

    @molinav
    Member

    Hi @SongJaeIn! It looks like the problem is coming from the current build dependency definition in the pyproject.toml, because it is pinning to a very specific numpy version (v1.16.6 for Python 3.9), and your computer fails to build this numpy version from source. I think numpy/numpy#17987 is the issue that you are seeing on MacOS, which was not solved until numpy v1.21.0.

    Your installed numpy library is newer (v1.23.1), which is perfectly normal. The original reason for being so specific with the numpy version for building is that we need to compile the distributed precompiled binary wheels with a very old numpy version to ensure that they work in as many computers as possible. For example, if the distributed wheels were compiled with numpy v1.23.1, later a user with numpy v1.19.5 would not be able to use them, but building basemap with an old numpy and later using basemap with a newer numpy does work. However, the combination of the former numpy bug on MacOS and the numpy pinning in the pyproject.toml is making you impossible to install basemap.

    Probably the implementation in pyproject.toml is at the moment too overkilling, and it could be enough to replace the numpy requirements so that they use >= instead of ==. Anyhow in the GitHub workflows I install old numpy libraries on purpose before building basemap, so the workflows would not suffer with the change from == to >=.

  2. molinav commented on Aug 6, 2022

    @molinav
    Member

    @SongJaeIn Can you try installing from the latest commit in the repository? You can do:

    python -m pip install https://github.com/matplotlib/basemap/archive/refs/heads/develop.zip#subdirectory=packages/basemap
    

    After installing, I also recommend you do the simple test:

    from mpl_toolkits import basemap

    to ensure that the _geoslib extension was built properly and that you can import it.

  3. molinav commented on Aug 6, 2022

    @molinav
    Member

    Ok so my changes seem to break the current GitHub workflows... I will need to edit the pyproject.toml file with specific build dependencies for MacOS.

  4. molinav commented on Aug 6, 2022

    @molinav
    Member

    @SongJaeIn Can you try once again with the same command? I have just updated the pyproject.toml file because my first attempt was not successful and it also broke the builds for Windows and GNU/Linux. Now the pyproject.toml file looks like this:

    'numpy == 1.21.4; sys_platform == "darwin" and (python_version >= "3.7" and python_version <= "3.9")',

    so now your computer should try to build basemap using numpy v1.21.4, which should be compilable on MacOS. And once built, you should be able to use basemap with any newer numpy. First ensure to uninstall the broken basemap:

    python -m pip uninstall basemap
    python -m pip install https://github.com/matplotlib/basemap/archive/refs/heads/develop.zip#subdirectory=packages/basemap
    python -c "from mpl_toolkits import basemap; print(basemap)"
    
  5. molinav commented on Aug 6, 2022

    @molinav
    Member

    RuntimeError Traceback (most recent call last)
    RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

    @SongJaeIn By the way, this RuntimeError is the reason why in the beginning we pin to very old numpy versions when building. It also gave me a bit of headaches in the past but was solved for Windows and GNU/Linux. Unfortunately I did not have a Mac around to also test the solution on Mac at that time, and you were unlucky that MacOS had this build problem with numpy until v1.21.0.

  6. molinav commented on Aug 6, 2022

    @molinav
    Member

    Great to hear that, @SongJaeIn! When I get some more time, I will prepare a patch release v1.3.4 with this correction and then you will be able to install basemap with pip as you were trying to do in the beginning.

  7. ihaseeburrehman commented on Dec 14, 2022

    @ihaseeburrehman

    Great to hear that, @SongJaeIn! When I get some more time, I will prepare a patch release v1.3.4 with this correction and then you will be able to install basemap with pip as you were trying to do in the beginning.

    @molinav I have installed Basemap -1.3.6+dev
    when I try python -c "from mpl_toolkits import basemap; print(basemap)"
    it gave me this
    <module 'mpl_toolkits.basemap' from '/opt/homebrew/Caskroom/miniconda/base/envs/matplot/lib/python3.10/site-packages/mpl_toolkits/basemap/init.py'>

    but when I try to test Basemap in Anaconda it says 'module not found'
    Furthermore , I tried pip install Basemap , it was unsuccessful (cc1: fatal error: src/_geoslib.c: No such file or directory)
    I set environment
    export GEOS_DIR=/opt/homebrew/Cellar/geos/3.11.1/

    I have Mac with M1-max running Ventura 13.0.1

    Appreciate if you can advise.

    thanks

  8. molinav commented on Dec 15, 2022

    @molinav
    Member

    Hi @ihaseeburrehman! I am not sure if I am understanding the issue. Do you have separate installations of Python, a normal one (e.g. from Homebrew, I assume Miniconda based on the basemap module path) and another one coming from Anaconda?

    The installation procedure for Miniconda and Anaconda should be the same in both cases on MacOS with M1. Since there are no precompiled wheels or conda packages for MacOS M1, you need to install basemap from the source distribution in PyPI with:

    python -m pip install basemap

    or it is even better if you install the dependencies manually with conda install and later do:

    python -m pip install --no-deps basemap

    Since you were able to install basemap for Miniconda, you seem to also have a working C/C++ compiler available to build the _geoslib module, so this is also not an issue. If you provide more feedback I can try to help a bit more.

  9. ihaseeburrehman commented on Dec 15, 2022

    @ihaseeburrehman

    Hi Thanks for your response.
    Let me try again to explain my issue
    in Mac terminal I have successfully installed basemap and also passed the test by executing the following command
    python -c "from mpl_toolkits import basemap; print(basemap)"
    I have attached the terminal window screenshot.
    Screenshot 2022-12-15 at 11 49 58
    But when I tried in Anaconda (Spyder)
    from mpl_toolkits import basemap

    it says
    ImportError: cannot import name 'basemap' from 'mpl_toolkits' (unknown location)

    I have attached the Spyder kernal screenshot.
    Screenshot 2022-12-15 at 11 51 47

    I am wondering why anaconda (Spyder) is not importing basemap from mpl_toolkits.

  10. molinav commented on Dec 15, 2022

    @molinav
    Member

    Thanks for the additional feedback, @ihaseeburrehman. The issue is that basemap is installed only in one of your Python installations:

    • basemap is installed for your Python from the /opt/homebrew/Caskroom/miniconda/base installation (Miniconda).
    • Spyder3 is using your Python from the /opt/anaconda3 installation (Anaconda3), for which basemap is not installed.

    The Python installations do not share packages, each has its own installation path. To have basemap in Spyder3, you need to install it for the appropriate Python installation, i.e. you need to do python -m pip install basemap after being sure that "python" does point to the Anaconda3 Python, not to the Miniconda one.

    You can check where Python is pointing to with:

    command -v python
  11. ihaseeburrehman commented on Dec 15, 2022

    @ihaseeburrehman

    I struggling with installation of basemap in anaconda.
    I tried
    pip install basemap

    it says "could not built wheels for basemap." it similar issue reported in #547
    Screenshot 2022-12-15 at 16 08 36

    I also set the environment for geos
    export GEOS_DIR=/opt/homebrew/Cellar/geos/3.11.1/

    but not able to install, any suggestion ?

  12. ihaseeburrehman commented on Dec 19, 2022

    @ihaseeburrehman

    Hi @molinav Thanks for your feedback .
    I skip installation of basemap in Anaconda (Spyder). Because in the end I need to use basemap in python console of QGIS.
    As I mentioned earlier basemap is installed in miniconda (from homebrew) successfully but when I tried to import it in QGIS python console it says "no module named _geoslib". Geoslib is also installed with version 3.11.1.
    I tried the same procedure on Linux machine and it completed with no error.
    But on Mac M1 it is giving me this error.
    I am not sure, but I think I need to define the geoslib path in QGIS (I did this in QGIS env), but not getting results.

    see the attached the picture.
    wonder if you can suggest something.
    thanks
    image

  13. drew-wks commented on Aug 3, 2023

    @drew-wks

    Hi @molinav,

    I tried installing basemap using the commands given above:

    pip install https://github.com/matplotlib/basemap/archive/refs/heads/develop.zip#subdirectory=packages/basemap

    but receive the same error:

    Collecting basemap-data<1.4,>=1.3.2 (from basemap->ezgpx)
    Using cached basemap_data-1.3.2-py2.py3-none-any.whl (30.5 MB)
    Collecting pyshp<2.4,>=1.2 (from basemap->ezgpx)
    Using cached pyshp-2.3.1-py2.py3-none-any.whl (46 kB)
    Collecting pyproj<3.6.0,>=1.9.3 (from basemap->ezgpx)
    Using cached pyproj-3.5.0-cp311-cp311-macosx_11_0_arm64.whl (5.7 MB)
    ...
    ERROR: Failed building wheel for basemap
    Failed to build basemap
    ERROR: Could not build wheels for basemap, which is required to install pyproject.toml-based projects

    Any ideas? Should I start a new issue?

  14. molinav commented on Aug 3, 2023

    @molinav
    Member

    Hi @dvvilkins! You can check if the issue is the same as described in #583. The latest Cython 3.0.0 conflicts with the current _geoslib.pyx file. A hotfix version 1.3.8 is ongoing but still not released, although you can install directly from the hotfix-1.3.8 branch instead of develop. In case it does not work, you can paste the complete traceback to understand the source of the issue.

  15. molinav commented on Dec 6, 2023

    @molinav
    Member

    I am creating MacOS ARM64 wheels locally before I publish them into PyPI. Is somebody with MacOS ARM64 willing to try them? Then I would be sure that what I am uploading to PyPI is actually working (I am not that experienced with MacOS). I would need to know the target Python that you are using.

    The wheels are bundling GEOS 3.6.5, so there would be no need to install anything manually apart from the basemap wheel itself.

  16. tamidodo commented on Dec 16, 2023

    @tamidodo

    @molinav I have MacOS ARM64 and am having trouble installing basemap because of the issues described above. Would be happy to try it out, I'm on Python 3.9.7.

  17. molinav commented on Dec 18, 2023

    @molinav
    Member

    Thanks @tamidodo! I will try to have the wheels ready by end of today. I will attach them here, just with ".zip" extension instead of ".whl" due to GitHub limitations on the message attachments.

    What is the environment in which you use Python? From python.org installer, from pyenv+homebrew, from Anaconda/Miniforge?

  18. tamidodo commented on Dec 18, 2023

    @tamidodo

    Sounds good, I use Anaconda.

  19. molinav commented on Dec 20, 2023

    @molinav
    Member

    @tamidodo Sorry for the late reply, I was busier than expected. I attach here the current wheel file for Python 3.9 (you need to remove the .zip at the end after downloading):
    basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl.zip

    Since you are working with Anaconda, I would suggest to install this wheel without the dependencies, and afterwards install the dependencies manually with conda (to keep within the conda ecosystem as much as possible):

    python -m pip install --no-deps basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
    conda install numpy matplotlib pyproj pyshp packaging basemap-data
    

    The wheel bundles its own precompiled GEOS dylib, which only depends on system libraries, so I hope it works for you without any tweaking. I am happy to hear any feedback from you!

  20. tamidodo commented on Dec 21, 2023

    @tamidodo

    So after downloading the file, I changed the filename:
    mv basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl.zip basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl

    And then tried to run the first command in my environment with python version 3.9.7 and got this error back:
    Screenshot 2023-12-21 at 12 46 55 PM

  21. molinav commented on Dec 21, 2023

    @molinav
    Member

    @tamidodo I also get the same error as you when I create a new virtual environment, but in my case it is caused by the pip default version (20.3.4), which is too old, I remember reading somewhere that macosx_11_0 was not identified as a valid platform for cases in which it should be so. If I upgrade pip then the installation proceeds as expected:

    vic@alpha:~$ python3.9 -m venv py39
    vic@alpha:~$ . py39/bin/activate
    (py39) vic@alpha:~$ python -m pip install basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl 
    ERROR: basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl is not a supported wheel on this platform.
    (py39) vic@alpha:~$ python -m pip --version
    pip 20.2.3 from /Users/vic/py39/lib/python3.9/site-packages/pip (python 3.9)
    (py39) vic@alpha:~$ python -m pip install --upgrade pip
    Collecting pip
      Using cached pip-23.3.2-py3-none-any.whl (2.1 MB)
    Installing collected packages: pip
      Attempting uninstall: pip
        Found existing installation: pip 20.2.3
        Uninstalling pip-20.2.3:
          Successfully uninstalled pip-20.2.3
    Successfully installed pip-23.3.2
    (py39) vic@alpha:~$ python -m pip --version
    pip 23.3.2 from /Users/vic/py39/lib/python3.9/site-packages/pip (python 3.9)
    (py39) vic@alpha:~$ python -m pip install basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl 
    Processing ./basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
    Collecting basemap-data<1.4,>=1.3.2 (from basemap==1.4.0.dev0)
      Using cached basemap_data-1.3.2-py2.py3-none-any.whl (30.5 MB)
    Collecting pyshp<2.4,>=1.2 (from basemap==1.4.0.dev0)
      Using cached pyshp-2.3.1-py2.py3-none-any.whl (46 kB)
    Collecting matplotlib<3.8,>=1.5 (from basemap==1.4.0.dev0)
      Using cached matplotlib-3.7.4-cp39-cp39-macosx_11_0_arm64.whl.metadata (5.7 kB)
    Collecting pyproj<3.7.0,>=1.9.3 (from basemap==1.4.0.dev0)
      Using cached pyproj-3.6.1-cp39-cp39-macosx_11_0_arm64.whl.metadata (31 kB)
    Collecting packaging<24.0,>=16.0 (from basemap==1.4.0.dev0)
      Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
    Collecting numpy<1.27,>=1.21 (from basemap==1.4.0.dev0)
      Using cached numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl.metadata (61 kB)
    Collecting contourpy>=1.0.1 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached contourpy-1.2.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (5.8 kB)
    Collecting cycler>=0.10 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
    Collecting fonttools>=4.22.0 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached fonttools-4.47.0-cp39-cp39-macosx_10_9_universal2.whl.metadata (157 kB)
    Collecting kiwisolver>=1.0.1 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached kiwisolver-1.4.5-cp39-cp39-macosx_11_0_arm64.whl.metadata (6.4 kB)
    Collecting pillow>=6.2.0 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached Pillow-10.1.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (9.5 kB)
    Collecting pyparsing>=2.3.1 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
    Collecting python-dateutil>=2.7 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
    Collecting importlib-resources>=3.2.0 (from matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached importlib_resources-6.1.1-py3-none-any.whl.metadata (4.1 kB)
    Collecting certifi (from pyproj<3.7.0,>=1.9.3->basemap==1.4.0.dev0)
      Using cached certifi-2023.11.17-py3-none-any.whl.metadata (2.2 kB)
    Collecting zipp>=3.1.0 (from importlib-resources>=3.2.0->matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Downloading zipp-3.17.0-py3-none-any.whl.metadata (3.7 kB)
    Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib<3.8,>=1.5->basemap==1.4.0.dev0)
      Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
    Using cached matplotlib-3.7.4-cp39-cp39-macosx_11_0_arm64.whl (7.3 MB)
    Using cached numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB)
    Using cached packaging-23.2-py3-none-any.whl (53 kB)
    Using cached pyproj-3.6.1-cp39-cp39-macosx_11_0_arm64.whl (4.9 MB)
    Using cached contourpy-1.2.0-cp39-cp39-macosx_11_0_arm64.whl (242 kB)
    Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
    Using cached fonttools-4.47.0-cp39-cp39-macosx_10_9_universal2.whl (2.8 MB)
    Using cached importlib_resources-6.1.1-py3-none-any.whl (33 kB)
    Using cached kiwisolver-1.4.5-cp39-cp39-macosx_11_0_arm64.whl (66 kB)
    Using cached Pillow-10.1.0-cp39-cp39-macosx_11_0_arm64.whl (3.3 MB)
    Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
    Using cached certifi-2023.11.17-py3-none-any.whl (162 kB)
    Downloading zipp-3.17.0-py3-none-any.whl (7.4 kB)
    Installing collected packages: zipp, six, pyshp, pyparsing, pillow, packaging, numpy, kiwisolver, fonttools, cycler, certifi, basemap-data, python-dateutil, pyproj, importlib-resources, contourpy, matplotlib, basemap
    Successfully installed basemap-1.4.0.dev0 basemap-data-1.3.2 certifi-2023.11.17 contourpy-1.2.0 cycler-0.12.1 fonttools-4.47.0 importlib-resources-6.1.1 kiwisolver-1.4.5 matplotlib-3.7.4 numpy-1.26.2 packaging-23.2 pillow-10.1.0 pyparsing-3.1.1 pyproj-3.6.1 pyshp-2.3.1 python-dateutil-2.8.2 six-1.16.0 zipp-3.17.0
    (py39) vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
    1.4.0-dev
    

    There is a couple of differences in my environment with respect to yours: Python 3.9 is installed from the official Python website (universal2 installer), and I am using simple Python virtual environments and pip to fetch dependencies (no conda). However, I cannot guess why it does not work in your environment, because you pip seems up to date.

    Some possible things I can be thinking of:

    • Do you have several Python versions in parallel?
    • If you try to upgrade pip with conda, does it say that it is already up to date (23.3.2)?
    • Is your Anaconda installation using Python for arm64 or for Python x86_64? It could be that the error message comes from a mismatch in the architecture.
  22. molinav commented on Dec 21, 2023

    @molinav
    Member

    I have just tested with pyenv installed from homebrew, in this case using pyenv to install Python 3.9.7 and then using the wheel works directly because the pip version is already 21.2.3:

    vic@alpha:~$ pyenv versions   
    * system (set by PYENV_VERSION environment variable)
      3.10.13
      3.11.6
      3.11.6/envs/py311
      3.12.0
      3.12.0/envs/py312
      py311 --> /Users/vic/.pyenv/versions/3.11.6/envs/py311
      py312 --> /Users/vic/.pyenv/versions/3.12.0/envs/py312
    vic@alpha:~$ pyenv install 3.9.7
    python-build: use openssl from homebrew
    python-build: use readline from homebrew
    Downloading Python-3.9.7.tar.xz...
    -> https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tar.xz
    Installing Python-3.9.7...
    patching file 'Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst'
    patching file configure
    patching file configure.ac
    python-build: use readline from homebrew
    python-build: use ncurses from homebrew
    python-build: use zlib from xcode sdk
    Installed Python-3.9.7 to /Users/vic/.pyenv/versions/3.9.7
    vic@alpha:~$ pyenv shell 3.9.7
    vic@alpha:~$ python -V
    Python 3.9.7
    vic@alpha:~$ python -m pip --version
    pip 21.2.3 from /Users/vic/.pyenv/versions/3.9.7/lib/python3.9/site-packages/pip (python 3.9)
    vic@alpha:~$ python -m pip install basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl 
    Processing ./basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
    Collecting basemap-data<1.4,>=1.3.2
      Downloading basemap_data-1.3.2-py2.py3-none-any.whl (30.5 MB)
         |████████████████████████████████| 30.5 MB 27.5 MB/s 
    Collecting packaging<24.0,>=16.0
      Using cached packaging-23.2-py3-none-any.whl (53 kB)
    Collecting pyshp<2.4,>=1.2
      Downloading pyshp-2.3.1-py2.py3-none-any.whl (46 kB)
         |████████████████████████████████| 46 kB 23.4 MB/s 
    Collecting numpy<1.27,>=1.21
      Downloading numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB)
         |████████████████████████████████| 14.0 MB 44.9 MB/s 
    Collecting pyproj<3.7.0,>=1.9.3
      Downloading pyproj-3.6.1-cp39-cp39-macosx_11_0_arm64.whl (4.9 MB)
         |████████████████████████████████| 4.9 MB 39.6 MB/s 
    Collecting matplotlib<3.8,>=1.5
      Downloading matplotlib-3.7.4-cp39-cp39-macosx_11_0_arm64.whl (7.3 MB)
         |████████████████████████████████| 7.3 MB 41.7 MB/s 
    Collecting kiwisolver>=1.0.1
      Downloading kiwisolver-1.4.5-cp39-cp39-macosx_11_0_arm64.whl (66 kB)
         |████████████████████████████████| 66 kB 22.9 MB/s 
    Collecting python-dateutil>=2.7
      Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
         |████████████████████████████████| 247 kB 41.4 MB/s 
    Collecting contourpy>=1.0.1
      Downloading contourpy-1.2.0-cp39-cp39-macosx_11_0_arm64.whl (242 kB)
         |████████████████████████████████| 242 kB 48.7 MB/s 
    Collecting fonttools>=4.22.0
      Downloading fonttools-4.47.0-cp39-cp39-macosx_10_9_universal2.whl (2.8 MB)
         |████████████████████████████████| 2.8 MB 50.9 MB/s 
    Collecting cycler>=0.10
      Downloading cycler-0.12.1-py3-none-any.whl (8.3 kB)
    Collecting pillow>=6.2.0
      Downloading Pillow-10.1.0-cp39-cp39-macosx_11_0_arm64.whl (3.3 MB)
         |████████████████████████████████| 3.3 MB 42.9 MB/s 
    Collecting importlib-resources>=3.2.0
      Downloading importlib_resources-6.1.1-py3-none-any.whl (33 kB)
    Collecting pyparsing>=2.3.1
      Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
    Collecting zipp>=3.1.0
      Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)
    Collecting certifi
      Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)
         |████████████████████████████████| 162 kB 44.2 MB/s 
    Collecting six>=1.5
      Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
    Installing collected packages: zipp, six, numpy, python-dateutil, pyparsing, pillow, packaging, kiwisolver, importlib-resources, fonttools, cycler, contourpy, certifi, pyshp, pyproj, matplotlib, basemap-data, basemap
    Successfully installed basemap-1.4.0.dev0 basemap-data-1.3.2 certifi-2023.11.17 contourpy-1.2.0 cycler-0.12.1 fonttools-4.47.0 importlib-resources-6.1.1 kiwisolver-1.4.5 matplotlib-3.7.4 numpy-1.26.2 packaging-23.2 pillow-10.1.0 pyparsing-3.1.1 pyproj-3.6.1 pyshp-2.3.1 python-dateutil-2.8.2 six-1.16.0 zipp-3.17.0
    vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
    1.4.0-dev
    

    I will try now with Anaconda or Miniforge and check.

  23. molinav commented on Dec 21, 2023

    @molinav
    Member

    I have just tested with Anaconda downloaded from their website (arm64 installer). I created an environment msc with Python version 3.9.7:

    (base) vic@alpha:~$ conda create -n msc python=3.9.7
    Collecting package metadata (current_repodata.json): done
    Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
    Collecting package metadata (repodata.json): done
    Solving environment: done
    
    
    ==> WARNING: A newer version of conda exists. <==
      current version: 23.7.4
      latest version: 23.11.0
    
    Please update conda by running
    
        $ conda update -n base -c defaults conda
    
    Or to minimize the number of packages updated during conda update use
    
         conda install conda=23.11.0
    
    
    
    ## Package Plan ##
    
      environment location: /Users/vic/anaconda3/envs/msc
    
      added / updated specs:
        - python=3.9.7
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        ca-certificates-2023.12.12 |       hca03da5_0         127 KB
        expat-2.5.0                |       h313beb8_0         144 KB
        openssl-1.1.1w             |       h1a28f6b_0         3.1 MB
        pip-23.3.1                 |   py39hca03da5_0         2.6 MB
        python-3.9.7               |       hc70090a_1         9.6 MB
        setuptools-68.2.2          |   py39hca03da5_0         933 KB
        wheel-0.41.2               |   py39hca03da5_0         107 KB
        xz-5.4.5                   |       h80987f9_0         366 KB
        ------------------------------------------------------------
                                               Total:        17.0 MB
    
    The following NEW packages will be INSTALLED:
    
      ca-certificates    pkgs/main/osx-arm64::ca-certificates-2023.12.12-hca03da5_0 
      expat              pkgs/main/osx-arm64::expat-2.5.0-h313beb8_0 
      libcxx             pkgs/main/osx-arm64::libcxx-14.0.6-h848a8c0_0 
      libffi             pkgs/main/osx-arm64::libffi-3.4.4-hca03da5_0 
      libiconv           pkgs/main/osx-arm64::libiconv-1.16-h1a28f6b_2 
      ncurses            pkgs/main/osx-arm64::ncurses-6.4-h313beb8_0 
      openssl            pkgs/main/osx-arm64::openssl-1.1.1w-h1a28f6b_0 
      pip                pkgs/main/osx-arm64::pip-23.3.1-py39hca03da5_0 
      python             pkgs/main/osx-arm64::python-3.9.7-hc70090a_1 
      readline           pkgs/main/osx-arm64::readline-8.2-h1a28f6b_0 
      setuptools         pkgs/main/osx-arm64::setuptools-68.2.2-py39hca03da5_0 
      sqlite             pkgs/main/osx-arm64::sqlite-3.41.2-h80987f9_0 
      tk                 pkgs/main/osx-arm64::tk-8.6.12-hb8d0fd4_0 
      tzdata             pkgs/main/noarch::tzdata-2023c-h04d1e81_0 
      wheel              pkgs/main/osx-arm64::wheel-0.41.2-py39hca03da5_0 
      xz                 pkgs/main/osx-arm64::xz-5.4.5-h80987f9_0 
      zlib               pkgs/main/osx-arm64::zlib-1.2.13-h5a0b063_0 
    
    
    Proceed ([y]/n)? y
    
    
    Downloading and Extracting Packages
                                                                                                                                                   
    Preparing transaction: done                                                                                                                    
    Verifying transaction: done                                                                                                                    
    Executing transaction: done                                                                                                                    
    #                                                                                                                                              
    # To activate this environment, use                                                                                                            
    #                                                                                                                                              
    #     $ conda activate msc                                                                                                                     
    #
    # To deactivate an active environment, use
    #
    #     $ conda deactivate
    
    (base) vic@alpha:~$ conda activate msc
    (msc) vic@alpha:~$ python -V
    Python 3.9.7
    

    And then I have tried to install basemap using the two-step approach (pip for the wheel without dependencies, conda for the dependencies added manually):

    (msc) vic@alpha:~$ python -m pip install --no-deps basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl  
    Processing ./basemap-1.4.0.dev0-cp39-cp39-macosx_11_0_arm64.whl
    Installing collected packages: basemap
    Successfully installed basemap-1.4.0.dev0
    (msc) vic@alpha:~$ conda install numpy matplotlib pyproj pyshp packaging basemap-data
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    
    
    ==> WARNING: A newer version of conda exists. <==
      current version: 23.7.4
      latest version: 23.11.0
    
    Please update conda by running
    
        $ conda update -n base -c defaults conda
    
    Or to minimize the number of packages updated during conda update use
    
         conda install conda=23.11.0
    
    
    
    ## Package Plan ##
    
      environment location: /Users/vic/anaconda3/envs/msc
    
      added / updated specs:
        - basemap-data
        - matplotlib
        - numpy
        - packaging
        - pyproj
        - pyshp
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        basemap-data-1.3.6         |   py39hca03da5_1        25.7 MB
        certifi-2023.11.17         |   py39hca03da5_0         159 KB
        contourpy-1.2.0            |   py39h48ca7d4_0         239 KB
        importlib_resources-6.1.1  |   py39hca03da5_0          56 KB
        kiwisolver-1.4.4           |   py39h313beb8_0          61 KB
        krb5-1.20.1                |       h8380606_1         1.2 MB
        libcurl-8.2.1              |       h0f1d93c_0         343 KB
        libdeflate-1.17            |       h80987f9_1          55 KB
        libedit-3.1.20230828       |       h80987f9_0         155 KB
        libnghttp2-1.52.0          |       h10c0552_1         628 KB
        libssh2-1.10.0             |       h449679c_2         289 KB
        matplotlib-3.8.0           |   py39hca03da5_0           9 KB
        matplotlib-base-3.8.0      |   py39h46d7db6_0         6.7 MB
        numpy-1.26.2               |   py39h3b2db8e_0          11 KB
        numpy-base-1.26.2          |   py39ha9811e2_0         5.8 MB
        packaging-23.1             |   py39hca03da5_0          77 KB
        pillow-10.0.1              |   py39h3b245a6_0         684 KB
        proj-8.2.1                 |       hb8d25fd_0         2.4 MB
        pyparsing-3.0.9            |   py39hca03da5_0         149 KB
        pyproj-3.4.1               |   py39h80bd9b1_0         421 KB
        pyshp-2.1.3                |     pyhd3eb1b0_0          37 KB
        tornado-6.3.3              |   py39h80987f9_0         635 KB
        zipp-3.11.0                |   py39hca03da5_0          20 KB
        ------------------------------------------------------------
                                               Total:        45.7 MB
    
    The following NEW packages will be INSTALLED:
    
      basemap-data       pkgs/main/osx-arm64::basemap-data-1.3.6-py39hca03da5_1 
      blas               pkgs/main/osx-arm64::blas-1.0-openblas 
      brotli             pkgs/main/osx-arm64::brotli-1.0.9-h1a28f6b_7 
      brotli-bin         pkgs/main/osx-arm64::brotli-bin-1.0.9-h1a28f6b_7 
      c-ares             pkgs/main/osx-arm64::c-ares-1.19.1-h80987f9_0 
      certifi            pkgs/main/osx-arm64::certifi-2023.11.17-py39hca03da5_0 
      contourpy          pkgs/main/osx-arm64::contourpy-1.2.0-py39h48ca7d4_0 
      cycler             pkgs/main/noarch::cycler-0.11.0-pyhd3eb1b0_0 
      fonttools          pkgs/main/noarch::fonttools-4.25.0-pyhd3eb1b0_0 
      freetype           pkgs/main/osx-arm64::freetype-2.12.1-h1192e45_0 
      giflib             pkgs/main/osx-arm64::giflib-5.2.1-h80987f9_3 
      importlib_resourc~ pkgs/main/osx-arm64::importlib_resources-6.1.1-py39hca03da5_0 
      jpeg               pkgs/main/osx-arm64::jpeg-9e-h80987f9_1 
      kiwisolver         pkgs/main/osx-arm64::kiwisolver-1.4.4-py39h313beb8_0 
      krb5               pkgs/main/osx-arm64::krb5-1.20.1-h8380606_1 
      lcms2              pkgs/main/osx-arm64::lcms2-2.12-hba8e193_0 
      lerc               pkgs/main/osx-arm64::lerc-3.0-hc377ac9_0 
      libbrotlicommon    pkgs/main/osx-arm64::libbrotlicommon-1.0.9-h1a28f6b_7 
      libbrotlidec       pkgs/main/osx-arm64::libbrotlidec-1.0.9-h1a28f6b_7 
      libbrotlienc       pkgs/main/osx-arm64::libbrotlienc-1.0.9-h1a28f6b_7 
      libcurl            pkgs/main/osx-arm64::libcurl-8.2.1-h0f1d93c_0 
      libdeflate         pkgs/main/osx-arm64::libdeflate-1.17-h80987f9_1 
      libedit            pkgs/main/osx-arm64::libedit-3.1.20230828-h80987f9_0 
      libev              pkgs/main/osx-arm64::libev-4.33-h1a28f6b_1 
      libgfortran        pkgs/main/osx-arm64::libgfortran-5.0.0-11_3_0_hca03da5_28 
      libgfortran5       pkgs/main/osx-arm64::libgfortran5-11.3.0-h009349e_28 
      libnghttp2         pkgs/main/osx-arm64::libnghttp2-1.52.0-h10c0552_1 
      libopenblas        pkgs/main/osx-arm64::libopenblas-0.3.21-h269037a_0 
      libpng             pkgs/main/osx-arm64::libpng-1.6.39-h80987f9_0 
      libssh2            pkgs/main/osx-arm64::libssh2-1.10.0-h449679c_2 
      libtiff            pkgs/main/osx-arm64::libtiff-4.5.1-h313beb8_0 
      libwebp            pkgs/main/osx-arm64::libwebp-1.3.2-ha3663a8_0 
      libwebp-base       pkgs/main/osx-arm64::libwebp-base-1.3.2-h80987f9_0 
      llvm-openmp        pkgs/main/osx-arm64::llvm-openmp-14.0.6-hc6e5704_0 
      lz4-c              pkgs/main/osx-arm64::lz4-c-1.9.4-h313beb8_0 
      matplotlib         pkgs/main/osx-arm64::matplotlib-3.8.0-py39hca03da5_0 
      matplotlib-base    pkgs/main/osx-arm64::matplotlib-base-3.8.0-py39h46d7db6_0 
      munkres            pkgs/main/noarch::munkres-1.1.4-py_0 
      numpy              pkgs/main/osx-arm64::numpy-1.26.2-py39h3b2db8e_0 
      numpy-base         pkgs/main/osx-arm64::numpy-base-1.26.2-py39ha9811e2_0 
      openjpeg           pkgs/main/osx-arm64::openjpeg-2.3.0-h7a6adac_2 
      packaging          pkgs/main/osx-arm64::packaging-23.1-py39hca03da5_0 
      pillow             pkgs/main/osx-arm64::pillow-10.0.1-py39h3b245a6_0 
      proj               pkgs/main/osx-arm64::proj-8.2.1-hb8d25fd_0 
      pyparsing          pkgs/main/osx-arm64::pyparsing-3.0.9-py39hca03da5_0 
      pyproj             pkgs/main/osx-arm64::pyproj-3.4.1-py39h80bd9b1_0 
      pyshp              pkgs/main/noarch::pyshp-2.1.3-pyhd3eb1b0_0 
      python-dateutil    pkgs/main/noarch::python-dateutil-2.8.2-pyhd3eb1b0_0 
      six                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1 
      tornado            pkgs/main/osx-arm64::tornado-6.3.3-py39h80987f9_0 
      zipp               pkgs/main/osx-arm64::zipp-3.11.0-py39hca03da5_0 
      zstd               pkgs/main/osx-arm64::zstd-1.5.5-hd90d995_0 
    
    
    Proceed ([y]/n)? y
    
    
    Downloading and Extracting Packages
                                                                                                                                                   
    Preparing transaction: done                                                                                                                    
    Verifying transaction: done                                                                                                                    
    Executing transaction: done                                                                                                                    
    (msc) vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
    1.4.0-dev
    
  24. tamidodo commented on Dec 25, 2023

    @tamidodo
    • Is your Anaconda installation using Python for arm64 or for Python x86_64? It could be that the error message comes from a mismatch in the architecture.

    Sorry for the delay, been busy with holiday things but this was a lovely Christmas surprise! This was what it was, my Anaconda installed Python for x86_64. Got the correct python for arm64 from miniforge and had no issues installing the wheel and getting it running! Thank you for your work on this, seems good to go!

  25. molinav commented on Dec 27, 2023

    @molinav
    Member

    @tamidodo One very last update, I managed to prepare the conda packages for MacOS ARM64 in the conda-forge channel. So now it should be even simpler as long as your environment stays within conda-forge, since you can install basemap with conda directly:

    (base) vic@alpha:~$ conda create -y -n msc39 -c conda-forge python=3.9 basemap
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    
    
    ==> WARNING: A newer version of conda exists. <==
      current version: 23.3.1
      latest version: 23.11.0
    
    Please update conda by running
    
        $ conda update -n base -c conda-forge conda
    
    Or to minimize the number of packages updated during conda update use
    
         conda install conda=23.11.0
    
    
    
    ## Package Plan ##
    
      environment location: /opt/homebrew/Caskroom/miniforge/base/envs/msc39
    
      added / updated specs:
        - basemap
        - python=3.9
    
    
    The following NEW packages will be INSTALLED:
    
      basemap            conda-forge/osx-arm64::basemap-1.3.9-py39hb118012_0 
      basemap-data       conda-forge/noarch::basemap-data-1.3.2-pyhd8ed1ab_3 
      brotli             conda-forge/osx-arm64::brotli-1.1.0-hb547adb_1 
      brotli-bin         conda-forge/osx-arm64::brotli-bin-1.1.0-hb547adb_1 
      bzip2              conda-forge/osx-arm64::bzip2-1.0.8-h93a5062_5 
      c-ares             conda-forge/osx-arm64::c-ares-1.24.0-h93a5062_0 
      ca-certificates    conda-forge/osx-arm64::ca-certificates-2023.11.17-hf0a4a13_0 
      certifi            conda-forge/noarch::certifi-2023.11.17-pyhd8ed1ab_0 
      contourpy          conda-forge/osx-arm64::contourpy-1.2.0-py39he9de807_0 
      cycler             conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_0 
      fonttools          conda-forge/osx-arm64::fonttools-4.47.0-py39h17cfd9d_0 
      freetype           conda-forge/osx-arm64::freetype-2.12.1-hadb7bae_2 
      geos               conda-forge/osx-arm64::geos-3.12.1-h965bd2d_0 
      importlib-resourc~ conda-forge/noarch::importlib-resources-6.1.1-pyhd8ed1ab_0 
      importlib_resourc~ conda-forge/noarch::importlib_resources-6.1.1-pyhd8ed1ab_0 
      kiwisolver         conda-forge/osx-arm64::kiwisolver-1.4.5-py39hbd775c9_1 
      krb5               conda-forge/osx-arm64::krb5-1.21.2-h92f50d5_0 
      lcms2              conda-forge/osx-arm64::lcms2-2.16-ha0e7c42_0 
      lerc               conda-forge/osx-arm64::lerc-4.0.0-h9a09cb3_0 
      libblas            conda-forge/osx-arm64::libblas-3.9.0-20_osxarm64_openblas 
      libbrotlicommon    conda-forge/osx-arm64::libbrotlicommon-1.1.0-hb547adb_1 
      libbrotlidec       conda-forge/osx-arm64::libbrotlidec-1.1.0-hb547adb_1 
      libbrotlienc       conda-forge/osx-arm64::libbrotlienc-1.1.0-hb547adb_1 
      libcblas           conda-forge/osx-arm64::libcblas-3.9.0-20_osxarm64_openblas 
      libcurl            conda-forge/osx-arm64::libcurl-8.5.0-h2d989ff_0 
      libcxx             conda-forge/osx-arm64::libcxx-16.0.6-h4653b0c_0 
      libdeflate         conda-forge/osx-arm64::libdeflate-1.19-hb547adb_0 
      libedit            conda-forge/osx-arm64::libedit-3.1.20191231-hc8eb9b7_2 
      libev              conda-forge/osx-arm64::libev-4.33-h93a5062_2 
      libffi             conda-forge/osx-arm64::libffi-3.4.2-h3422bc3_5 
      libgfortran        conda-forge/osx-arm64::libgfortran-5.0.0-13_2_0_hd922786_1 
      libgfortran5       conda-forge/osx-arm64::libgfortran5-13.2.0-hf226fd6_1 
      libjpeg-turbo      conda-forge/osx-arm64::libjpeg-turbo-3.0.0-hb547adb_1 
      liblapack          conda-forge/osx-arm64::liblapack-3.9.0-20_osxarm64_openblas 
      libnghttp2         conda-forge/osx-arm64::libnghttp2-1.58.0-ha4dd798_1 
      libopenblas        conda-forge/osx-arm64::libopenblas-0.3.25-openmp_h6c19121_0 
      libpng             conda-forge/osx-arm64::libpng-1.6.39-h76d750c_0 
      libsqlite          conda-forge/osx-arm64::libsqlite-3.44.2-h091b4b1_0 
      libssh2            conda-forge/osx-arm64::libssh2-1.11.0-h7a5bd25_0 
      libtiff            conda-forge/osx-arm64::libtiff-4.6.0-ha8a6c65_2 
      libwebp-base       conda-forge/osx-arm64::libwebp-base-1.3.2-hb547adb_0 
      libxcb             conda-forge/osx-arm64::libxcb-1.15-hf346824_0 
      libzlib            conda-forge/osx-arm64::libzlib-1.2.13-h53f4e23_5 
      llvm-openmp        conda-forge/osx-arm64::llvm-openmp-17.0.6-hcd81f8e_0 
      matplotlib-base    conda-forge/osx-arm64::matplotlib-base-3.7.3-py39h6685e7c_0 
      munkres            conda-forge/noarch::munkres-1.1.4-pyh9f0ad1d_0 
      ncurses            conda-forge/osx-arm64::ncurses-6.4-h463b476_2 
      numpy              conda-forge/osx-arm64::numpy-1.26.2-py39heee92a0_0 
      openjpeg           conda-forge/osx-arm64::openjpeg-2.5.0-h4c1507b_3 
      openssl            conda-forge/osx-arm64::openssl-3.2.0-h0d3ecfb_1 
      packaging          conda-forge/noarch::packaging-23.2-pyhd8ed1ab_0 
      pillow             conda-forge/osx-arm64::pillow-10.1.0-py39h755f0b7_0 
      pip                conda-forge/noarch::pip-23.3.2-pyhd8ed1ab_0 
      proj               conda-forge/osx-arm64::proj-9.3.1-h93d94ba_0 
      pthread-stubs      conda-forge/osx-arm64::pthread-stubs-0.4-h27ca646_1001 
      pyparsing          conda-forge/noarch::pyparsing-3.1.1-pyhd8ed1ab_0 
      pyproj             conda-forge/osx-arm64::pyproj-3.6.1-py39hd1c2dfb_5 
      pyshp              conda-forge/noarch::pyshp-2.3.1-pyhd8ed1ab_0 
      python             conda-forge/osx-arm64::python-3.9.18-hd7ebdb9_1_cpython 
      python-dateutil    conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0 
      python_abi         conda-forge/osx-arm64::python_abi-3.9-4_cp39 
      readline           conda-forge/osx-arm64::readline-8.2-h92ec313_1 
      setuptools         conda-forge/noarch::setuptools-68.2.2-pyhd8ed1ab_0 
      six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0 
      sqlite             conda-forge/osx-arm64::sqlite-3.44.2-hf2abe2d_0 
      tk                 conda-forge/osx-arm64::tk-8.6.13-h5083fa2_1 
      tzdata             conda-forge/noarch::tzdata-2023d-h0c530f3_0 
      unicodedata2       conda-forge/osx-arm64::unicodedata2-15.1.0-py39h0f82c59_0 
      wheel              conda-forge/noarch::wheel-0.42.0-pyhd8ed1ab_0 
      xorg-libxau        conda-forge/osx-arm64::xorg-libxau-1.0.11-hb547adb_0 
      xorg-libxdmcp      conda-forge/osx-arm64::xorg-libxdmcp-1.1.3-h27ca646_0 
      xz                 conda-forge/osx-arm64::xz-5.2.6-h57fd34a_0 
      zipp               conda-forge/noarch::zipp-3.17.0-pyhd8ed1ab_0 
      zstd               conda-forge/osx-arm64::zstd-1.5.5-h4f39d0f_0 
    
    
    
    Downloading and Extracting Packages
    
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    #
    # To activate this environment, use
    #
    #     $ conda activate msc39
    #
    # To deactivate an active environment, use
    #
    #     $ conda deactivate
    

    And then a simple import test:

    (base) vic@alpha:~$ conda activate msc39
    (msc39) vic@alpha:~$ python -c "from mpl_toolkits import basemap; print(basemap.__version__)"
    1.3.9
    

    I will be closing the issue, since we have conda packages of basemap 1.3.9 for MacOS ARM64, and with basemap 1.4.0 I will be uploading the MacOS ARM64 wheels to PyPI too. Thanks for your help and feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions