I am not on a MacOS, never used GMT, however, how about starting from scratch in a brand new Julia environment and using Conda that comes with PythonCall.jl. This is not about “uninstall everything and reinstall them all over again”, however, it should bring pretty similar results (I have not tried it):
# Creating a new project directory
mkdir path/GMTenv # make a directory for your project environment
# Start Julia
julia
# Activating a new Julia environment;
using Pkg
cd("path/GMTenv") # cd to your project environment
pwd() # double check if you are in the right directory
Pkg.activate(".") # activate a new environment
Pkg.instantiate()
Pkg.status() # double check if its activated
# Adding and using PythonCall.jl;
Pkg.add(url="https://github.com/cjdoris/PythonCall.jl.git") # adding master version of PythonCall
using PythonCall
# Checks
PythonCall.Deps.status() # check
PythonCall.Deps.conda_env() # check
PythonCall.Deps.user_deps_file() # check
# Installing GMT from conda channel;
PythonCall.Deps.add(conda_channels = ["conda-forge"]) # add conda-forge chennel ## COMMENT OUT WHEN RUNNING julia sample.jl
PythonCall.Deps.add(conda_packages = ["gmt=6.2"]) # add gmt 6.2.
# If by any chance you need additional dependencies like netcdf install them in a similar way
# Checks
PythonCall.Deps.status() # check
PythonCall.Deps.conda_env() # check
PythonCall.Deps.user_deps_file() # check
# Exit julia (IT WILL BE NEEDED AFTER ADDING CONDA PACKAGES)
exit()
# And start julia again (IT WILL BE NEEDED AFTER ADDING CONDA PACKAGES)
julia
# Activating a Julia environment;
using Pkg
cd("path/GMTenv") # cd to your project environment
pwd() # double check if you are in the right directory
Pkg.activate(".") # activate a new environment
Pkg.instantiate()
Pkg.status() # double check if its activated
# By using PythonCall, your new Conda environment will be activated in your Julia project environment
using PythonCall
# Checks
PythonCall.Deps.status() # check
PythonCall.Deps.conda_env() # check
PythonCall.Deps.user_deps_file() # check
# Add GMT.jl
Pkg.add(GMT) ## COMMENT OUT WHEN RUNNING julia sample.jl
using GMT
# Your sample project code goes here: