How to use PythonCall with a previous Conda environment

Conda.jl and CondaPkg.jl are separate entities. PyCall.jl uses Conda.jl and PythonCall.jl uses CondaPkg.jl by default.

Looking at it does seem that CondaPkg.jl tries to activate it’s own environment and doesn’t seem to recognize when it’s already in one.

One way to change the situation is to set JULIA_PYTHONCALL_EXE according to Guide · PythonCall & JuliaCall

If we set

ENV["JULIA_PYTHONCALL_EXE"] = "@PyCall"

or

ENV["JULIA_PYTHONCALL_EXE"] = joinpath(ENV["CONDA_PREFIX"], "bin", "python")

before launching PythonCall, then it seems to just use the current conda environment.

@cjdoris, is this the only way to use the currently activated conda environment rather than making a new one?