Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Libs/Application/Job/PythonWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ using namespace pybind11::literals; // to bring in the `_a` literal
#include <QThread>
#include <iostream>

#ifdef _WIN32
#include <windows.h>
#endif

namespace shapeworks {

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -207,6 +211,21 @@ bool PythonWorker::init() {

qputenv("PATH", path.toUtf8());
SW_LOG("Setting PATH for Python to: " + path.toStdString());

// Python 3.8+ requires explicit DLL directory registration
// PATH environment variable is no longer used for DLL search
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_USER_DIRS);

// Add the Library\bin directory where conda keeps DLLs like libexpat.dll
QString library_bin = python_home + "/Library/bin";
AddDllDirectory(library_bin.toStdWString().c_str());

// Also add the DLLs directory
QString dlls_dir = python_home + "/DLLs";
AddDllDirectory(dlls_dir.toStdWString().c_str());

// And the base python home
AddDllDirectory(python_home.toStdWString().c_str());
}
#endif // ifdef _WIN32

Expand Down
5 changes: 4 additions & 1 deletion Support/package_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ ROOT=`pwd`

BUILD="/c/build"
CONDA_LOC="/c/Miniconda/envs/shapeworks"
cp ${CONDA_LOC}/python*.dll ${CONDA_LOC}/Library/bin/zlib.dll ${CONDA_LOC}/Library/bin/tbb12.dll ${CONDA_LOC}/Library/bin/zstd.dll ${CONDA_LOC}/Library/bin/libpng16.dll ${CONDA_LOC}/Library/bin/half.dll ${CONDA_LOC}/Library/bin/boost_filesystem.dll ${CONDA_LOC}/Library/bin/spdlog.dll ${CONDA_LOC}/Library/bin/*ffi*.dll ${CONDA_LOC}/Library/bin/libbz2.dll $BUILD/bin/Release

ls -la ${CONDA_LOC}/Library/bin

cp ${CONDA_LOC}/python*.dll ${CONDA_LOC}/Library/bin/zlib.dll ${CONDA_LOC}/Library/bin/tbb12.dll ${CONDA_LOC}/Library/bin/zstd.dll ${CONDA_LOC}/Library/bin/libpng16.dll ${CONDA_LOC}/Library/bin/half.dll ${CONDA_LOC}/Library/bin/boost_filesystem.dll ${CONDA_LOC}/Library/bin/spdlog.dll ${CONDA_LOC}/Library/bin/*ffi*.dll ${CONDA_LOC}/Library/bin/libbz2.dll ${CONDA_LOC}/Library/bin/libssl-3-x64.dll ${CONDA_LOC}/Library/bin/libcrypto-3-x64.dll ${CONDA_LOC}/Library/bin/pcre2-16.dll $BUILD/bin/Release

# install visual studio redistributables
WIN_DIR="/c/Windows/system32"
Expand Down
6 changes: 3 additions & 3 deletions install_shapeworks.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ call conda config --add channels anaconda
call conda config --add channels conda-forge

REM install shapeworks deps
call conda create --yes --name %CONDAENV% python=3.9.13 pip=22.1.2 openssl==1.1.1w || goto :error
call conda create --yes --name %CONDAENV% python=3.12 pip=24.3.1 openssl==0.3.30 || goto :error
call conda activate %CONDAENV%

REM reactivate shapeworks environment
Expand All @@ -21,10 +21,10 @@ call conda activate %CONDAENV%
call python -m pip install -r python_requirements.txt || goto :error

REM install ptorch using light-the-torch
call ltt install torch==1.11.0 || goto :error
call ltt install torch==2.2.2 || goto :error

REM different versions of open3d for different OSes, so we install it manually here
call pip install open3d==0.17.0 || goto :error
call pip install open3d==0.19.0 || goto :error

call pip install Python/DatasetUtilsPackage.tar.gz || goto :error
call pip install Python/DocumentationUtilsPackage.tar.gz || goto :error
Expand Down
Loading