When I pip install cartopy from PyPI on MacOS I get #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'.
I'm not quite sure what the fix is, but I'm thinking I need to downgrade proj to v4? It's feels really nice when I can install things from brew & pip鈥攁nd unfortunately if it is a version issue, it's harder to installer older versions with brew than just me compiling proj myself. So if there's another work around where I don't have to manage the proj dependency, that would be amazing. 馃槃
brew install proj
pyenv virtualenv 3.6.8 cartopy
pip install cython
pip install cartopy
Collecting cartopy==0.17.0
Using cached https://files.pythonhosted.org/packages/e5/92/fe8838fa8158931906dfc4f16c5c1436b3dd2daf83592645b179581403ad/Cartopy-0.17.0.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: setuptools>=0.7.2 in /Users/munro/.pyenv/versions/3.6.8/envs/my_project/lib/python3.6/site-packages (from cartopy==0.17.0) (40.8.0)
Requirement already satisfied: pyshp>=1.1.4 in /Users/munro/.pyenv/versions/3.6.8/envs/my_project/lib/python3.6/site-packages (from cartopy==0.17.0) (2.1.0)
Requirement already satisfied: shapely>=1.5.6 in /Users/munro/.pyenv/versions/3.6.8/envs/my_project/lib/python3.6/site-packages/Shapely-1.7a1-py3.6-macosx-10.14-x86_64.egg (from cartopy==0.17.0) (1.7a1)
Requirement already satisfied: six>=1.3.0 in /Users/munro/.pyenv/versions/3.6.8/envs/my_project/lib/python3.6/site-packages (from cartopy==0.17.0) (1.12.0)
Requirement already satisfied: numpy>=1.10 in /Users/munro/.pyenv/versions/3.6.8/envs/my_project/lib/python3.6/site-packages (from cartopy==0.17.0) (1.16.1)
Building wheels for collected packages: cartopy
Building wheel for cartopy (PEP 517) ... error
Complete output from command /Users/munro/.pyenv/versions/3.6.8/envs/my_project/bin/python3.6 /Users/munro/.pyenv/versions/3.6.8/envs/my_project/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/30/nxgf13d122b_904_8xb6lj6mc2qnxr/T/tmpmpohjt_u:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.6
creating build/lib.macosx-10.14-x86_64-3.6/cartopy
copying lib/cartopy/_version.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy
copying lib/cartopy/_epsg.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy
copying lib/cartopy/util.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy
copying lib/cartopy/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy
copying lib/cartopy/crs.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy
copying lib/cartopy/img_transform.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy
copying lib/cartopy/vector_transform.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/sphinxext
copying lib/cartopy/sphinxext/summarise_package.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/sphinxext
copying lib/cartopy/sphinxext/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/sphinxext
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/io
copying lib/cartopy/io/img_tiles.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/io
copying lib/cartopy/io/shapereader.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/io
copying lib/cartopy/io/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/io
copying lib/cartopy/io/img_nest.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/io
copying lib/cartopy/io/srtm.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/io
copying lib/cartopy/io/ogc_clients.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/io
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_features.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_coding_standards.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_img_nest.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_coastline.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_geodesic.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_shapereader.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_vector_transform.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_line_string.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_util.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_crs_transform_vectors.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_polygon.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_linear_ring.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_img_tiles.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_img_transform.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
copying lib/cartopy/tests/test_crs.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/geodesic
copying lib/cartopy/geodesic/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/geodesic
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/un_flag.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/star_shaped_boundary.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/tick_labels.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/arrows.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/tube_stations.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/effects_of_the_ellipse.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/tissot.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/favicon.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/feature_creation.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/eccentric_ellipse.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/features.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/wmts.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/eyja_volcano.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/geostationary.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/hurricane_katrina.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/wms.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/regridding_arrows.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/logo.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/rotated_pole.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/global_map.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/utm_all_zones.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/always_circular_stereo.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/aurora_forecast.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/waves.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/image_tiles.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/reprojected_wmts.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/axes_grid_basic.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/wmts_time.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/barbs.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/nightshade.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
copying lib/cartopy/examples/streamplot.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/examples
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/patch.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/slippy_image_artist.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/feature_artist.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/clip_path.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/geoaxes.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/ticker.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
copying lib/cartopy/mpl/gridliner.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/mpl
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/feature
copying lib/cartopy/feature/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/feature
copying lib/cartopy/feature/nightshade.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/feature
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/io
copying lib/cartopy/tests/io/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/io
copying lib/cartopy/tests/io/test_downloaders.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/io
copying lib/cartopy/tests/io/test_ogc_clients.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/io
copying lib/cartopy/tests/io/test_srtm.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/io
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_plots.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_features.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_images.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_set_extent.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_nightshade.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_shapely_to_mpl.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_gridliner.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_ticker.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_patch.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_quiver.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_img_transform.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_web_services.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_caching.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_crs.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_contour.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_ticks.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_axes.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_pseudo_color.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_examples.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_feature_artist.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
copying lib/cartopy/tests/mpl/test_mpl_integration.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/feature
copying lib/cartopy/tests/feature/test_nightshade.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/feature
copying lib/cartopy/tests/feature/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/feature
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_orthographic.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_eckert.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_robinson.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_mercator.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_rotated_geodetic.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_geostationary.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_rotated_pole.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_sinusoidal.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_equidistant_conic.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_nearside_perspective.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/__init__.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_miller.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_mollweide.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_interrupted_goode_homolosine.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_lambert_conformal.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_lambert_azimuthal_equal_area.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_transverse_mercator.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_equal_earth.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_utm.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_albers_equal_area.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_azimuthal_equidistant.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_gnomonic.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
copying lib/cartopy/tests/crs/test_stereographic.py -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/crs
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_ticks
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_ticks/xticks_no_transform.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_ticks
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_ticks/yticks_cylindrical.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_ticks
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_ticks/xyticks.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_ticks
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_ticks/yticks_no_transform.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_ticks
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_ticks/xticks_cylindrical.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_ticks
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_images
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_images/imshow_natural_earth_ortho.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_images
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_images/image_nest.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_images
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_images/image_merge.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_images
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_images/web_tiles.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_images
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_images/imshow_regional_projected.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_images
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_web_services
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_web_services/wms.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_web_services
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_web_services/wmts.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_web_services
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_gridliner
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_gridliner/gridliner_labels.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_gridliner
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_gridliner/gridliner1.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_gridliner
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_gridliner/gridliner_labels_1.5.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_gridliner
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_img_transform
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_img_transform/regrid_image.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_img_transform
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_shapely_to_mpl
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_shapely_to_mpl/poly_interiors.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_shapely_to_mpl
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_shapely_to_mpl/contour_with_interiors.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_shapely_to_mpl
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_examples
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_examples/global_map.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_examples
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_nightshade
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_nightshade/nightshade_platecarree.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_nightshade
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_img_tiles2
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_img_tiles2/web_tiles.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_img_tiles2
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_crs
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/lambert_conformal_south.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_crs
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/mercator_squashed.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_crs
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_features
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_features/natural_earth_custom.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_features
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_features/gshhs_coastlines.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_features
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_features/wfs.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_features
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_features/natural_earth.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_features
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/pcolormesh_goode_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/quiver_rotated_pole.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/multiple_projections520.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/multiple_projections5.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/quiver_plate_carree.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/streamplot_mpl_2.1.0.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/natural_earth_interface.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/multiple_projections4.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/global_contour_wrap_mpl_pre_3.0.0.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/streamplot_mpl_1.4.3.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/barbs_1d.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/barbs_1d_transformed.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/pcolormesh_global_wrap1.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/streamplot_mpl_2.0.0.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/pcolormesh_global_wrap2.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/pcolormesh_global_wrap3.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/barbs_plate_carree.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/streamplot_mpl_3.0.0.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/global_contour_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/pcolormesh_limited_area_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/pcolormesh_single_column_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/barbs_regrid.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/quiver_regrid_with_extent.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/pcolormesh_mercator_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/global_map.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/global_scatter_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/global_contourf_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/quiver_regrid.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/global_pcolor_wrap.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/simple_global.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
copying lib/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration/barbs_regrid_with_extent.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/mpl/baseline_images/mpl/test_mpl_integration
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/raster
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/raster/natural_earth
copying lib/cartopy/data/raster/natural_earth/images.json -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/raster/natural_earth
copying lib/cartopy/data/raster/natural_earth/50-natural-earth-1-downsampled.png -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/raster/natural_earth
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/raster/sample
copying lib/cartopy/data/raster/sample/Miriam.A2012270.2050.2km.jpg -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/raster/sample
copying lib/cartopy/data/raster/sample/Miriam.A2012270.2050.2km.README.txt -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/raster/sample
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/netcdf
copying lib/cartopy/data/netcdf/HadISST1_SST_update.README.txt -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/netcdf
copying lib/cartopy/data/netcdf/HadISST1_SST_update.nc -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/netcdf
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs
copying lib/cartopy/data/shapefiles/gshhs/README.TXT -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/c
copying lib/cartopy/data/shapefiles/gshhs/c/GSHHS_c_L1.dbf -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/c
copying lib/cartopy/data/shapefiles/gshhs/c/GSHHS_c_L1.shx -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/c
copying lib/cartopy/data/shapefiles/gshhs/c/GSHHS_c_L1.shp -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/c
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/l
copying lib/cartopy/data/shapefiles/gshhs/l/GSHHS_l_L2.dbf -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/l
copying lib/cartopy/data/shapefiles/gshhs/l/GSHHS_l_L2.shp -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/l
copying lib/cartopy/data/shapefiles/gshhs/l/GSHHS_l_L2.shx -> build/lib.macosx-10.14-x86_64-3.6/cartopy/data/shapefiles/gshhs/l
creating build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/lakes_shapefile
copying lib/cartopy/tests/lakes_shapefile/ne_110m_lakes.dbf -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/lakes_shapefile
copying lib/cartopy/tests/lakes_shapefile/ne_110m_lakes.shp -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/lakes_shapefile
copying lib/cartopy/tests/lakes_shapefile/ne_110m_lakes.shx -> build/lib.macosx-10.14-x86_64-3.6/cartopy/tests/lakes_shapefile
copying lib/cartopy/io/srtm.npz -> build/lib.macosx-10.14-x86_64-3.6/cartopy/io
UPDATING build/lib.macosx-10.14-x86_64-3.6/cartopy/_version.py
set build/lib.macosx-10.14-x86_64-3.6/cartopy/_version.py to '0.17.0'
running build_ext
cythoning lib/cartopy/trace.pyx to lib/cartopy/trace.cpp
building 'cartopy.trace' extension
creating build/temp.macosx-10.14-x86_64-3.6
creating build/temp.macosx-10.14-x86_64-3.6/lib
creating build/temp.macosx-10.14-x86_64-3.6/lib/cartopy
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/munro/.pyenv/versions/3.6.8/Python.framework/Versions/3.6/include -I./lib/cartopy -I/usr/local/Cellar/proj/6.0.0/include -I/usr/local/Cellar/geos/3.7.1_1/include -I/Users/munro/.pyenv/versions/3.6.8/envs/my_project/include -I/Users/munro/.pyenv/versions/3.6.8/Python.framework/Versions/3.6/include/python3.6m -c lib/cartopy/trace.cpp -o build/temp.macosx-10.14-x86_64-3.6/lib/cartopy/trace.o
In file included from lib/cartopy/trace.cpp:607:
/usr/local/Cellar/proj/6.0.0/include/proj_api.h:37:2: error: 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
#error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
^
In file included from lib/cartopy/trace.cpp:608:
In file included from ./lib/cartopy/_trace.h:27:
/usr/local/Cellar/proj/6.0.0/include/proj_api.h:37:2: error: 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
#error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
^
2 errors generated.
/private/var/folders/30/nxgf13d122b_904_8xb6lj6mc2qnxr/T/pip-build-env-w5kmgzxy/overlay/lib/python3.6/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/30/nxgf13d122b_904_8xb6lj6mc2qnxr/T/pip-install-v6tba690/cartopy/lib/cartopy/trace.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for cartopy
Running setup.py clean for cartopy
Failed to build cartopy
Could not build wheels for cartopy which use PEP 517 and cannot be installed directly
Full environment definition
macOS 10.14.3
cartopy==0.17.0
Python v3.6.8
Cython==0.29.6
numpy==1.16.2
pyshp==2.1.0
Shapely==1.6.4.post2
six==1.12.0
After hours of trying to install cartopy, and getting a bunch of different errors, I've finally given up with the same error as OP posted (ACCEPT_USE_OF_DEPRECATED_PROJ_API_H).
Fixed in #1289
While #1289 is still open you can install an older version with HomeBrew by following the advice here. I installed version 5.2.0 with
brew uninstall proj
brew tap-new $USER/local-tap
brew extract --version=5.2.0 proj $USER/local-tap
brew install [email protected]
and then was able to pip install cartopy
Thanks a lot @grrrizzzz, that worked like a charm for me!
Any idea when this fix will be pushed to PyPI? I just encountered this.
Same issue on Ubuntu 18.04 for me.
Same issue, MacOSX 10.14.6 with brew install proj6.2.0
gcc-9 -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/include -I./lib/cartopy -I/usr/local/Cellar/geos/3.7.2/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c lib/cartopy/trace.cpp -o build/temp.macosx-10.9-x86_64-3.7/lib/cartopy/trace.o
In file included from lib/cartopy/trace.cpp:612:
/usr/local/include/proj_api.h:37:2: error: #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
37 | #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
| ^~~~~
In file included from lib/cartopy/_trace.h:27,
from lib/cartopy/trace.cpp:613:
/usr/local/include/proj_api.h:37:2: error: #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
37 | #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
| ^~~~~
/private/var/folders/xp/h3k9vf3n2jx181ts786_yjrn9c2gjq/T/pip-build-env-rj77k7iu/overlay/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/xp/h3k9vf3n2jx181ts786_yjrn9c2gjq/T/pip-install-mcd5412s/cartopy/lib/cartopy/trace.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
error: command 'gcc-9' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for cartopy
Running setup.py clean for cartopy
Failed to build cartopy
ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed directly
But this seemed to work:
https://github.com/SciTools/cartopy/pull/1289#issuecomment-506025563
export CFLAGS="-I/usr/local/include" && export LDFLAGS="-L/usr/local/lib" && python3.7 -m pip install git+https://github.com/snowman2/cartopy.git@5e624fe
1) something up with the original bug that I ran into, but 2) something specific to my machine because it was having trouble finding the proj libs (from brew)
This is fixed by #1289, so no need to keep open.
Most helpful comment
While #1289 is still open you can install an older version with HomeBrew by following the advice here. I installed version 5.2.0 with
and then was able to
pip install cartopy