Julia Conda : Not a Conda environment error

322 Views Asked by At

I want to run python from julia using PyCall and Conda.jl. Once I added Conda to one of julia environments, a conda environment was automatically created,

(base) ➜  ~ conda info --envs

# Out >
                         /Users/imantha/.julia/conda/3
base                  *  /Users/imantha/Software/miniforge3
CRTTEnv                  /Users/imantha/Software/miniforge3/envs/CRTTEnv
mlEnv                    /Users/imantha/Software/miniforge3/envs/mlEnv
nlpEnv                   /Users/imantha/Software/miniforge3/envs/nlpEnv
pyEnv                    /Users/imantha/Software/miniforge3/envs/pyEnv

The very first one is the julia environment.

Now when enter the following in Julia i get,

julia> using Conda
julia> Conda.PYTHONDIR

# Out >
"/Users/imantha/.julia/conda/3/bin"

But if I try to add package or find the installed packages I get

julia> Conda.list(Conda.PYTHONDIR)

# Out >
EnvironmentLocationNotFound: Not a conda environment: /Users/imantha/.julia/conda/3/bin

ERROR: failed process: Process(setenv(`/Users/imantha/.julia/conda/3/bin/conda list`,["XPC_FLAGS=0x0", "LSCOLORS=Gxfxcxdxbxegedabagacad", "PATH=/Users/imantha/Software/miniforge3/bin:/Users/imantha/Software/miniforge3/condabin:/Users/imantha/.cabal/bin:/Users/imantha/.ghcup/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Julia-1.6.app/Contents/Resources/julia/bin:/Users/imantha/Software/anaconda3/bin:/Applications/R.app/Contents/MacOS/R#:/Library/PostgreSQL/9.4/bin", "_CE_M=", "PWD=/Users/imantha", "XPC_SERVICE_NAME=0", "TERM_PROGRAM=Apple_Terminal", "HOMEBREW_PREFIX=/opt/homebrew", "SHELL=/bin/zsh", "__CF_USER_TEXT_ENCODING=0x1F5:0:2"  …  "HOMEBREW_REPOSITORY=/opt/homebrew", "_CE_CONDA=", "USER=imantha", "TERM=xterm-256color", "HOME=/Users/imantha", "TERM_PROGRAM_VERSION=440", "OPENBLAS_MAIN_FREE=1", "LESS=-R", "PYTHONIOENCODING=UTF-8", "ZSH=/Users/imantha/.oh-my-zsh"]), ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error
   @ ./process.jl:525 [inlined]
 [2] run(::Cmd; wait::Bool)
   @ Base ./process.jl:440
 [3] run
   @ ./process.jl:438 [inlined]
 [4] runconda(args::Cmd, env::String)
   @ Conda ~/.julia/packages/Conda/sNGum/src/Conda.jl:129
 [5] list(env::String)
   @ Conda ~/.julia/packages/Conda/sNGum/src/Conda.jl:262
 [6] top-level scope
   @ REPL[34]:1

Any ideas why this maybe ?

0

There are 0 best solutions below