matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
772 stars 390 forks source link

Basemap fails to install using pip on macOS (M1) #596

Closed unbeatable-101 closed 6 months ago

unbeatable-101 commented 6 months ago
Collecting basemap
  Using cached basemap-1.3.9.zip (156 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      Ignoring numpy: markers 'python_version == "3.10"' don't match your environment
      Ignoring numpy: markers 'sys_platform == "darwin" and (python_version >= "3.7" and python_version <= "3.9")' don't match your environment
      Ignoring numpy: markers 'sys_platform != "darwin" and (python_version >= "3.7" and python_version <= "3.9")' don't match your environment
      Ignoring numpy: markers 'python_version == "2.7" or (python_version >= "3.4" and python_version <= "3.6")' 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
        Using cached setuptools-69.0.3-py3-none-any.whl.metadata (6.3 kB)
      Collecting wheel
        Using cached wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
      Collecting numpy==1.23.3
        Using cached numpy-1.23.3-cp311-cp311-macosx_11_0_arm64.whl (13.3 MB)
      Collecting cython<3.0,>=0.29
        Using cached Cython-0.29.37-py2.py3-none-any.whl.metadata (3.1 kB)
      Using cached setuptools-69.0.3-py3-none-any.whl (819 kB)
      Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
      Using cached Cython-0.29.37-py2.py3-none-any.whl (989 kB)
      Installing collected packages: wheel, setuptools, numpy, cython
      ERROR: Cannot set --home and --prefix together

      [notice] A new release of pip is available: 23.3.1 -> 23.3.2
      [notice] To update, run: python3.11 -m pip install --upgrade pip
      [end of output]
molinav commented 6 months ago

Hi, @unbeatable-101! I have never seen this kind of error when installing basemap from its sdist, does the following link help? Maybe you have PIP_TARGET defined on your environment: https://stackoverflow.com/questions/72297487/pip-install-error-cannot-set-home-and-prefix-together

unbeatable-101 commented 6 months ago

The issue turned out to be this in pip.conf

[global]
target = /opt/homebrew/lib/python3.10/site-packages/

after commenting out it built

molinav commented 6 months ago

Great to hear! I am closing the issue then.