Skip to content

Errors when installing Basemap in Mac os #447

Closed

Description

@yansinhuang

I'm running these in my Mac' s terminal, with python 3.7.0.
It seems to be some problems with numpy or Cython but I pretty sure I have already installed them.
numpy 1.15.4
Cython 0.29.2
pyproj 1.9.5.1
geos 0.2.1
Above are some relative module that I already have.

Any idea or suggestions?

Yande-MacBook-Air:basemap-1.1.0 yan$ python3 setup.py install
`/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'namespace_packages'
warnings.warn(msg)
running install
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 extension "_geoslib" sources
build_src: building npy-pkg config files
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building '_geoslib' extension
compiling C sources
C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g

compile options: '-Iinclude -I['/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include'] -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c'
gcc: src/_geoslib.c
error: unable to open output file 'build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o': 'Permission denied'
1 error generated.
error: unable to open output file 'build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o': 'Permission denied'
1 error generated.
error: Command "gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Iinclude -I['/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include'] -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_geoslib.c -o build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o -MMD -MF build/temp.macosx-10.9-x86_64-3.7/src/_geoslib.o.d" failed with exit status 1`

Activity

  1. molinav commented on Oct 25, 2022

    @molinav
    Member

    I know that I am coming super-late here, but there has been significant development on the basemap packaging in the last months. We are still missing precompiled binary wheels for MacOS, but it should be straightforward to install from the source distribution available in PyPI:

    1. First, you need to have an appropriate installation of GEOS (e.g. through HomeBrew) and a C compiler.
    2. Then, set the environment variable GEOS_DIR to the installation folder (i.e. the geos_c.h header should be found in ${GEOS_DIR}/include).
    3. Finally, install basemap with pip normally: python -m pip install basemap
    4. Optionally, if you need the high-resolution datasets: python -m pip install basemap-data-hires

    Feel free to try out and report any issues from following the former steps.

  2. molinav commented on Jan 6, 2024

    @molinav
    Member

    I am closing the issue, because with the upcoming release 1.4.0 (in a couple of days) I will be uploading MacOS wheels to PyPI manually, and since release 1.3.9 we already have MacOS arm64 packages in the conda-forge channel, so hopefully these installation issues on MacOS will become less common.

    Feel free to reopen the issue if any of the problems persists.

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