Old Conda environment in Julia

It seems that I have an old Conda environment in Julia: /Users/sbac/.julia/conda/3/lib/python3.7.

I am using now other Python environments with Python version 3.12. I can’t find the name of this environment. How can I (should I) update this Julia environment?

I am having a lot of problems with Quarto in Julia and I suspect that is due to the fact of not having pyyaml installed in that environment.

This is a base environment installed by PyCall.jl using miniconda or miniforge.

If you still need PyCall.jl for something, you can try a few approaches. There is probably a conda binary located here, which you could run.

/Users/sbac/.julia/conda/3/bin/conda

You could also just move the .julia/conda to .julia/conda.bak. Then do

using Pkg
Pkg.build("PyCall")

That should download a fresh conda install into that directory. The problem is that you may need to install individual Python packages again.

An alternative is that you can configure PyCall.jl to use another Python executable via the the Python environment variable PYTHON (ENV["PYTHON"] inside Julia). See the instructions in the README below:

The newer package PythonCall.jl behaves differently and provides individual conda environments for your Julia projects. You might need to use PythonPlot.jl rather than PyPlot.jl for example though.

2 Likes