Julia startup error during initialization of module GMP

With a fresh installation of julia on my mac (running High Sierra version 10.13.6), I am getting a “Error during initialization of module GMP” message on startup. I get the same error when I try to use packages like PyPlot. My homebrew-installed version of gmp is 6.1.2_2.

How do I diagnose what is the cause?

exec '/Applications/Julia-1.3.app/Contents/Resources/julia/bin/julia'
~$ exec '/Applications/Julia-1.3.app/Contents/Resources/julia/bin/julia'
WARNING: Error during initialization of module GMP:
UndefVarError(var=:warn)
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.3.0 (2019-11-26)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> 
julia> using PyPlot
[ Info: Precompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]
WARNING: Error during initialization of module GMP:
UndefVarError(var=:warn)
ImportError: No module named site
ERROR: Failed to precompile PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee] to /Users/y9KAaixxegjR/.julia/compiled/v1.3/PyPlot/oatAj_AyYny.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1283
 [3] _require(::Base.PkgId) at ./loading.jl:1024
 [4] require(::Base.PkgId) at ./loading.jl:922
 [5] require(::Module, ::Symbol) at ./loading.jl:917

@ararslan’s comment on https://github.com/JuliaLang/julia/issues/25273 fixed my problem: just like eric-nok, I had my DYLD_LIBRARY_PATH set to include the MATLAB runtime library. Commenting that out of my bash profile was all that was needed.

How exactly did you do this? I have the same problem, but my bash profile, which I open by running

touch ~/.bash_profile; open ~/.bash_profile

looks like

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/sebastianmyrback/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/sebastianmyrback/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/sebastianmyrback/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/sebastianmyrback/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

However, I can’t find any “DYLD_LIBRARY_PATH” here.