basemap: Problem on installation 1.3.1 with sdist

Environment macOS Monterey Version 12.1 Chip Apple M1 Max Python 3.10.1

With the goes library as below

brew install geos
export $GEOS_DIR=/opt/homebrew/Cellar/geos/3.10.2/
/opt/homebrew/Cellar/geos/3.10.2/

I tried to install basemap following the comments on #531

poetry add basemap
# same symptom with pip

but installation failed with error

EnvCommandError

  Command ['/Users/yuujin/Workspace/.venv/bin/pip', 'install', '--no-deps', 'file:///Users/yuujin/Library/Caches/pypoetry/artifacts/b1/eb/1a/6b80b1e92c9b7b023c7d118d790f51ffc701b0c0e5f1e87b6959ab1b89/basemap-1.3.1.zip'] errored with the following return code 1, and output: 
  Processing /Users/yuujin/Library/Caches/pypoetry/artifacts/b1/eb/1a/6b80b1e92c9b7b023c7d118d790f51ffc701b0c0e5f1e87b6959ab1b89/basemap-1.3.1.zip
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /Users/yuujin/Workspace/.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-req-build-diy_eywu/setup.py'"'"'; __file__='"'"'/private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-req-build-diy_eywu/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'"'"'))' egg_info --egg-base /private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-pip-egg-info-548b08zr
         cwd: /private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-req-build-diy_eywu/
    Complete output (9 lines):
    /private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-req-build-diy_eywu/setup.py:52: RuntimeWarning: Cannot find GEOS library and/or headers in standard locations ('/opt/homebrew/Cellar/geos/3.10.2/'). Please install the corresponding packages using your software management system or set the environment variable GEOS_DIR to point to the location where GEOS is installed (for example, if 'geos_c.h' is in '/usr/local/include' and 'libgeos_c' is in '/usr/local/lib', then you need to set GEOS_DIR to '/usr/local'
      warnings.warn(" ".join([
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-req-build-diy_eywu/setup.py", line 149, in <module>
        dev_requires = get_content("requirements-dev.txt", splitlines=True)
      File "/private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-req-build-diy_eywu/setup.py", line 23, in get_content
        with io.open(path, encoding="utf-8") as fd:
    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/5r/0p5dh9vx78qbptqmcm3zmgdm0000gn/T/pip-req-build-diy_eywu/requirements-dev.txt'
    ----------------------------------------
  WARNING: Discarding file:///Users/yuujin/Library/Caches/pypoetry/artifacts/b1/eb/1a/6b80b1e92c9b7b023c7d118d790f51ffc701b0c0e5f1e87b6959ab1b89/basemap-1.3.1.zip. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Even there exist header and built binary ‘geos_c.h’ and ‘libgeos_c’ in $GEOS_DIR

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments

@molinav Hey! This got me past the install step (M1 Pro), with an extra python3 -c "import utils; utils.GeosLibrary('3.5.1').build(installdir='${GEOS_DIR}')" step in the middle. All working now 🚀

Python 3.10.2, pip 22.0.4