|
16 | 16 |
|
17 | 17 |
|
18 | 18 | set(; python = nothing, inprocess = false, conda = false) = |
19 | | - set(PythonPreferences(get_python_fullpath(python), inprocess, conda)) |
| 19 | + set(PythonPreferences(python, inprocess, conda)) |
20 | 20 |
|
21 | 21 | function set(prefs::PythonPreferences) |
22 | 22 | @debug "setting new Python Preferences" prefs |
23 | 23 | if prefs.python === nothing |
24 | 24 | @delete_preferences!("python") |
25 | 25 | else |
26 | | - @set_preferences!("python" => prefs.python) |
| 26 | + @set_preferences!("python" => get_python_fullpath(prefs.python)) |
27 | 27 | end |
28 | 28 | if prefs.inprocess |
29 | 29 | @set_preferences!("inprocess" => prefs.inprocess) |
@@ -51,7 +51,15 @@ function _load_python_preferences() |
51 | 51 | _inprocess = @load_preference("inprocess", false) |
52 | 52 | _conda = @load_preference("conda", false) |
53 | 53 | #isempty(rawprefs) && return nothing |
54 | | - return PythonPreferences(_python, _inprocess, _conda) |
| 54 | + |
| 55 | + # default value |
| 56 | + if !_inprocess && !_conda && _python === nothing |
| 57 | + _python = get_python_fullpath(get_default_python()) |
| 58 | + @info "Setting default Python interpreter to $(_python)" |
| 59 | + return set(python=_python) |
| 60 | + else |
| 61 | + return PythonPreferences(_python, _inprocess, _conda) |
| 62 | + end |
55 | 63 | end |
56 | 64 |
|
57 | 65 | function load_pypreferences_code() |
|
0 commit comments