ClimatePlots installation

I am not able to install the ClimatePlots package, due to a problem with the conda manager, that seems to not properly install matplotlib.
I have completely uninstalled julia (executable and configuration-packages directories) and installed it again, but the problem persists.
I have followed the steps in:
https://juliaclimate.github.io/ClimateTools.jl/dev/installation/
id est:

julia> using Pkg; Pkg.add("PyCall")
julia> ENV["PYTHON"]=""
julia> Pkg.build("PyCall")
pkg> add ClimatePlots # Tagged release

But in the last step I get the following error and warning:

185 dependencies successfully precompiled in 76 seconds. 16 already precompiled.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
  1 dependency had warnings during precompilation:
┌ Polynomials [f27b6e38-b328-58d1-80ce-0feddd5e7a45]
│  WARNING: method definition for showterm at /home/antonio/.julia/packages/Polynomials/1aa8e/src/polynomials/ChebyshevT.jl:224 declares type variable N but does not use it.

So I do what the message recommends and the full output follows:

julia> import Pkg; Pkg.precompile()
Precompiling project...
  ✗ ClimatePlots
  0 dependencies successfully precompiled in 19 seconds. 201 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

ClimatePlots [b71d359b-899c-4fb1-b3ad-2de2d2cb8353]

Failed to precompile ClimatePlots [b71d359b-899c-4fb1-b3ad-2de2d2cb8353] to "/home/antonio/.julia/compiled/v1.9/ClimatePlots/jl_eP0hE6".
[ Info: Installing matplotlib via the Conda matplotlib package...
[ Info: Running `conda install -y matplotlib` in root environment

ResolvePackageNotFound: 
  - conda==23.1.0

ERROR: LoadError: InitError: failed process: Process(setenv(`/home/antonio/.julia/conda/3/x86_64/bin/conda install -y matplotlib`,["_CE_M=", "PATH=/home/antonio/bin:/home/antonio/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", "ZES_ENABLE_SYSMAN=1", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "LANG=es_ES.UTF-8", "LOGNAME=antonio", "SHLVL=1", "LC_MONETARY=es_ES.UTF-8", "XDG_RUNTIME_DIR=/run/user/1000", "JULIA_IMAGE_THREADS=1"  …  "SSH_CLIENT=10.1.20.68 46174 22", "JULIA_LOAD_PATH=/home/antonio/.julia/environments/v1.9/Project.toml:/home/antonio/julia-1.9.2/share/julia/stdlib/v1.9", "_CE_CONDA=", "SSH_TTY=/dev/pts/5", "HOME=/home/antonio", "TERM=xterm-256color", "MKL_NUM_THREADS=1", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", "OPENBLAS_MAIN_FREE=1", "PYTHONIOENCODING=UTF-8"]), ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] runconda(args::Cmd, env::String)
    @ Conda ~/.julia/packages/Conda/xMClC/src/Conda.jl:128
  [5] add(pkg::String, env::String; channel::String, satisfied_skip_solve::Bool, args::Cmd)
    @ Conda ~/.julia/packages/Conda/xMClC/src/Conda.jl:229
  [6] add (repeats 2 times)
    @ ~/.julia/packages/Conda/xMClC/src/Conda.jl:222 [inlined]
  [7] pyimport_conda(modulename::String, condapkg::String, channel::String)
    @ PyCall ~/.julia/packages/PyCall/ilqDX/src/PyCall.jl:721
  [8] pyimport_conda
    @ ~/.julia/packages/PyCall/ilqDX/src/PyCall.jl:715 [inlined]
  [9] __init__()
    @ PyPlot ~/.julia/packages/PyPlot/H01LC/src/init.jl:173
 [10] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1115
 [11] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1061
 [12] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1506
 [13] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1783
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
 [15] macro expansion
    @ ./loading.jl:1648 [inlined]
 [16] macro expansion
    @ ./lock.jl:267 [inlined]
 [17] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
 [18] include
    @ ./Base.jl:457 [inlined]
 [19] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2049
 [20] top-level scope
    @ stdin:3
during initialization of module PyPlot
in expression starting at /home/antonio/.julia/packages/ClimatePlots/xAY5A/src/ClimatePlots.jl:1
in expression starting at stdin:3

caused by: PyError (PyImport_ImportModule

The Python package matplotlib could not be imported by pyimport. Usually this means
that you did not install matplotlib in the Python version being used by PyCall.

PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package.  To install the matplotlib module, you can
use `pyimport_conda("matplotlib", PKG)`, where PKG is the Anaconda
package that contains the module matplotlib, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).

Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python.   As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'matplotlib'")

Stacktrace:
  [1] pyimport(name::String)
    @ PyCall ~/.julia/packages/PyCall/ilqDX/src/PyCall.jl:558
  [2] pyimport_conda(modulename::String, condapkg::String, channel::String)
    @ PyCall ~/.julia/packages/PyCall/ilqDX/src/PyCall.jl:716
  [3] pyimport_conda
    @ ~/.julia/packages/PyCall/ilqDX/src/PyCall.jl:715 [inlined]
  [4] __init__()
    @ PyPlot ~/.julia/packages/PyPlot/H01LC/src/init.jl:173
  [5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1115
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1061
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1506
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1783
  [9] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
 [10] macro expansion
    @ ./loading.jl:1648 [inlined]
 [11] macro expansion
    @ ./lock.jl:267 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
 [13] include
    @ ./Base.jl:457 [inlined]
 [14] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2049
 [15] top-level scope
    @ stdin:3
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types ~/julia-1.9.2/share/julia/stdlib/v1.9/Pkg/src/Types.jl:69
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
   @ Pkg.API ~/julia-1.9.2/share/julia/stdlib/v1.9/Pkg/src/API.jl:1581
 [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/julia-1.9.2/share/julia/stdlib/v1.9/Pkg/src/API.jl:156
 [4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API ~/julia-1.9.2/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
 [5] precompile(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/julia-1.9.2/share/julia/stdlib/v1.9/Pkg/src/API.jl:171
 [6] precompile()
   @ Pkg.API ~/julia-1.9.2/share/julia/stdlib/v1.9/Pkg/src/API.jl:162
 [7] top-level scope
   @ REPL[7]:1

Is there a solution for this problem? Is ClimatePlots being maintained?. If not, what are the alternatives?
My system information is (Ubuntu 22.04.2 LTS):

$ versioninfo()
Julia Version 1.9.2
Commit e4ee485e909 (2023-07-05 09:39 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × AMD Ryzen 9 7950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 28 on 32 virtual cores
Environment:
  JULIA_NUM_THREADS = 28
  JULIA_IMAGE_THREADS = 1

I don’t think this is a ClimatePlots problem, but a problem with your Conda environment. Even if you try and install PyPlot.jl independent of ClimatePlots you’ll get the same error if Conda can’t find matplotlib. These Conda python dependencies I struggle with myself but you can try and install matplolib through pip in your shell as

python -m pip install matplotlib

And then point in Julia to

ENV["PYTHON"]="/path/to/python"

before building PyCall and ClimatePlots in Julia.

This worked!.
Thanks a lot. The point was that I was using a not complete path to python, id est, my python environment (the answer of the command “which python”) is:
/home/antonio/miniconda3/envs/forge/bin/python
But I thought that I had to use only the path, id est:
/home/antonio/miniconda3/envs/forge/bin/
And this did not work. So, we have to use the path including the file name of the python executable file.
This is not clear in the documentation.