Skip to content

Commit 626ebb2

Browse files
committed
Auto-build environment when turning on python mode
If it doesn't already exist
1 parent bf9ef54 commit 626ebb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/scijava/plugins/scripting/python/OptionsPython.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,13 @@ public void save() {
187187
log.debug(exc);
188188
}
189189

190+
if (pythonMode && (pythonDir == null || !pythonDir.exists())) {
191+
rebuildEnv();
192+
}
190193
// Warn the user if pythonMode was just enabled and wasn't before
191194
if (!initialPythonMode && pythonMode && uiService != null) {
192195
String msg =
193-
"You have just enabled Python mode. Please restart for these changes to take effect!\n\n" +
196+
"You have just enabled Python mode. Please restart for these changes to take effect! (after your python environment initializes, if needed)\n\n" +
194197
"If Fiji fails to start, try deleting your configuration file and restarting.\n\nConfiguration file: " +
195198
configFile;
196199
uiService.showDialog(msg, "Python Mode Enabled",

0 commit comments

Comments
 (0)