Skip to content

Commit 991d394

Browse files
committed
use env variable
1 parent ca894ea commit 991d394

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

PyPreferences.jl/src/core.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ function PyPreferences.recompile()
8484
return
8585
end
8686

87+
"""
88+
Returns the default python executable used by PyCall. This defaults to
89+
`python3`, and can be overridden by `ENV["PYTHON"]` if it is desired.
90+
"""
91+
get_default_python() = get(ENV,"PYTHON", "python3")
92+
8793
function get_python_fullpath(python)
8894
python_fullpath = nothing
8995
if python !== nothing
@@ -112,12 +118,11 @@ function setup_non_failing()
112118
inprocess = prefs.inprocess
113119
conda = prefs.conda
114120

115-
if !inprocess
121+
if !inprocess
116122
if conda
117123
python = python_fullpath = conda_python_fullpath()
118124
elseif python === nothing
119-
# TODO: mimic PyCall's deps/build.jl
120-
python = "python3"
125+
python = get_default_python()
121126
end
122127

123128
@debug "Python binary selected. Attempting to find the path" python

0 commit comments

Comments
 (0)