Skip to content

Commit 29a2cc6

Browse files
committed
Conda needs PYTHONHOME to work!?
1 parent 6d3cd03 commit 29a2cc6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

PythonForDelphi/Components/Sources/Core/PythonVersions.pas

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ procedure TPythonVersion.AssignTo(PythonEngine: TPersistent);
126126
if Is_venv then begin
127127
TPythonEngine(PythonEngine).VenvPythonExe := PythonExecutable;
128128
TPythonEngine(PythonEngine).SetPythonHome(DLLPath);
129-
end else if not IsRegistered then
129+
end else if not IsRegistered or Is_conda then
130+
// Not sure why but PythonHome needs to be set even for
131+
// registered conda distributions
132+
// Note also that for conda distributions to work properly,
133+
// you need to add Format('%s;%0:s\Library\bin;', [Version.InstallPath]
134+
// to your Windows path if it is not there already.
130135
TPythonEngine(PythonEngine).SetPythonHome(InstallPath);
131136
end;
132137
end;

0 commit comments

Comments
 (0)