File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ using namespace pybind11::literals; // to bring in the `_a` literal
1616#include < QThread>
1717#include < iostream>
1818
19+ #ifdef _WIN32
20+ #include < windows.h>
21+ #endif
22+
1923namespace shapeworks {
2024
2125// ---------------------------------------------------------------------------
@@ -207,6 +211,21 @@ bool PythonWorker::init() {
207211
208212 qputenv (" PATH" , path.toUtf8 ());
209213 SW_LOG (" Setting PATH for Python to: " + path.toStdString ());
214+
215+ // Python 3.8+ requires explicit DLL directory registration
216+ // PATH environment variable is no longer used for DLL search
217+ SetDefaultDllDirectories (LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_USER_DIRS);
218+
219+ // Add the Library\bin directory where conda keeps DLLs like libexpat.dll
220+ QString library_bin = python_home + " /Library/bin" ;
221+ AddDllDirectory (library_bin.toStdWString ().c_str ());
222+
223+ // Also add the DLLs directory
224+ QString dlls_dir = python_home + " /DLLs" ;
225+ AddDllDirectory (dlls_dir.toStdWString ().c_str ());
226+
227+ // And the base python home
228+ AddDllDirectory (python_home.toStdWString ().c_str ());
210229 }
211230#endif // ifdef _WIN32
212231
You can’t perform that action at this time.
0 commit comments