Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#56150 closed defect (fixed)

py36-cartopy @0.15.1_2: install fails: can't find proj

Reported by: mndavidoff (Monte Davidoff) Owned by: petrrr
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc: Veence (Vincent), scrallen, anowacki (Andy Nowacki), dbevans (David B. Evans), Chergnat
Port: py-cartopy


Installing py36-cartopy gets this error:

$ sudo port -vs install py36-cartopy
--->  Computing dependencies for py36-cartopy.
--->  Fetching distfiles for py36-cartopy
--->  Verifying checksums for py36-cartopy
--->  Checksumming cartopy-0.15.1.tar.gz
--->  Extracting py36-cartopy
--->  Extracting cartopy-0.15.1.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cartopy/py36-cartopy/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/py-cartopy/cartopy-0.15.1.tar.gz' | /usr/bin/tar -xf - 
--->  Configuring py36-cartopy
--->  Building py36-cartopy
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cartopy/py36-cartopy/work/cartopy-0.15.1" && /opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 --no-user-cfg build 
Proj4 4.9.0 must be installed.
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cartopy/py36-cartopy/work/cartopy-0.15.1" && /opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 --no-user-cfg build 
Exit code: 1
Error: Failed to build py36-cartopy: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cartopy/py36-cartopy/main.log for details.
Error: Follow to report a bug.
Error: Processing of port py36-cartopy failed

The proj4 port installs /opt/local/lib/proj49/bin/proj, so maybe the py-cartopy can't find the proj executable there.

Attachments (1)

main.log.gz (8.2 KB) - added by mndavidoff (Monte Davidoff) 3 years ago.

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by mndavidoff (Monte Davidoff)

Attachment: main.log.gz added

comment:1 Changed 3 years ago by mf2k (Frank Schima)

Cc: petr@… removed
Owner: set to petrrr
Status: newassigned

comment:2 Changed 3 years ago by ryandesign (Ryan Schmidt)

Cc: Veence added

comment:3 Changed 3 years ago by scrallen

Cc: scrallen added

comment:4 Changed 2 years ago by news24lor


Yes. It does not see proj49 folder. This problem is similar to other packages (py-spatialite, ...)

I've resolved with symbolic link.

$ sudo ln -s /opt/local/lib/proj49/bin/geod /opt/local/bin/
$ sudo ln -s /opt/local/lib/proj49/bin/nad2bin /opt/local/bin/
$ sudo ln -s /opt/local/lib/proj49/bin/proj /opt/local/bin/
$ sudo ln -s /opt/local/lib/proj49/lib/libproj.dylib /opt/local/lib/
$ sudo ln -s /opt/local/lib/proj49/lib/libproj.a /opt/local/lib/
$ sudo ln -s /opt/local/lib/proj49/include/proj_api.h /opt/local/include
$ sudo ln -s /opt/local/lib/proj49/include/geodesic.h /opt/local/include/
$ sudo ln -s /opt/local/lib/proj49/include/org_proj4_PJ.h /opt/local/include/
$ sudo ln -s /opt/local/lib/proj49/include/org_proj4_Projections.h /opt/local/include/

comment:5 Changed 2 years ago by platipodium (Carsten Lemmen)

Just to confirm @news24lor solution works for me, and for py27-spatialite

comment:6 Changed 2 years ago by anowacki (Andy Nowacki)

Cc: anowacki added

comment:7 Changed 2 years ago by dbevans (David B. Evans)

Cc: dbevans added

This appears to be the result of the recent commit that allows both proj4 and proj (version 5) to install in parallel by installing them in versioned directories under ${prefix}/lib

See e3710d6800e803ebaa9528d3bdb38fb2fcade513/macports-ports

The proj executables are now installed in


Adding the symbolic links would cause these two ports to conflict once again.

A better solution would be to configure and/or patch this port and the others effected to correctly find the proj/proj5 install path.

As stated above, python ports that depends on proj4 are


Python ports that depend directly on proj 5.0 are

py-pyproj     (fixed, builds with either, proj by default)                  
Last edited 2 years ago by dbevans (David B. Evans) (previous) (diff)

comment:8 in reply to:  4 Changed 2 years ago by ryandesign (Ryan Schmidt)

Cc: Chergnat added

Has duplicate #56266.

Replying to news24lor:

I've resolved with symbolic link.

Make sure you remove those symlinks later. The files were moved around for a reason; creating these symlinks subverts that.

comment:9 Changed 2 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

In 0c5b6630d7069764bc950a02c71ea93011ae75ff/macports-ports:

py-cartopy: update to version 0.16.0, dependencies, configuration

  • build requires pkgconfig
  • add search paths for proj4 binary and pkgconfig files to build/destroot env
  • allows to identify proj4 non-standard location and build flags

Closes #56150

comment:10 Changed 2 years ago by dbevans (David B. Evans)

In 7bd182906a0fdcff28a5a53b1a2791059886b399/macports-ports:

py-spatialite: build fix for relocated proj4

Add proj4 include and lib paths to

See #56150
Closes #56175

Note: See TracTickets for help on using tickets.