From 7d4f6ca163f8432ad6758db87e97cd23457a942e Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 5 Sep 2018 21:46:48 -0700 Subject: [PATCH] Make anaconda_conda work in PyJulia ... imported in python interpreter statically-linked to libpython. --- src/PyCall.jl | 3 +++ src/startup.jl | 1 + 2 files changed, 4 insertions(+) diff --git a/src/PyCall.jl b/src/PyCall.jl index 71bb65e4..0c189d18 100644 --- a/src/PyCall.jl +++ b/src/PyCall.jl @@ -622,6 +622,9 @@ function anaconda_conda() if conda || !occursin("conda", unsafe_string(ccall(@pysym(:Py_GetVersion), Ptr{UInt8}, ()))) return "" end + if isempty(pyprogramname) + return "" + end aconda = joinpath(dirname(pyprogramname), "conda") return isfile(aconda) ? aconda : "" end diff --git a/src/startup.jl b/src/startup.jl index daf3d615..203c78f0 100644 --- a/src/startup.jl +++ b/src/startup.jl @@ -80,6 +80,7 @@ else # If we're not in charge, assume the user is installing necessary python # libraries rather than messing with their configuration const conda = false + const pyprogramname = "" end const pyversion = vparse(split(Py_GetVersion(libpy_handle))[1])