diff --git a/Installation/install_python_module.bat b/Installation/install_python_module.bat index caebb3c9fe..809511e585 100644 --- a/Installation/install_python_module.bat +++ b/Installation/install_python_module.bat @@ -1,9 +1,6 @@ REM Installs the shapeworks python module. REM NOTE: assumes all library dependencies are in this directory\bin -REM install pip module -call pip install Python\shapeworks.tar.gz - set CONDA_INSTALL_DIR=%CONDA_PREFIX%\lib\site-packages\shapeworks :: format windows path to use forward slashes diff --git a/Installation/install_python_module.sh b/Installation/install_python_module.sh index ddfb007edd..ded7ffcc72 100755 --- a/Installation/install_python_module.sh +++ b/Installation/install_python_module.sh @@ -3,8 +3,6 @@ # Installs shapeworks Python module # Ensures conda Python module is able to locate correct shapeworks_py binary module. -# install pip module -if ! pip install Python/shapeworks; then exit -1; fi CONDA_INSTALL_DIR=`pip show shapeworks | grep Location | awk '{print $2}'`/shapeworks diff --git a/Python/shapeworks/shapeworks/setup_path.py b/Python/shapeworks/shapeworks/setup_path.py index 3e0f07b2e4..85f56a7961 100644 --- a/Python/shapeworks/shapeworks/setup_path.py +++ b/Python/shapeworks/shapeworks/setup_path.py @@ -1,3 +1,3 @@ def setup_binary_path(): import sys - sys.path.append("placeholder_string") + sys.path.append("/Users/amorris/sci/shapeworks/code/bin") diff --git a/Support/package.sh b/Support/package.sh index 95387c4389..b06c2af9e5 100755 --- a/Support/package.sh +++ b/Support/package.sh @@ -46,6 +46,14 @@ rm -rf "package/$VERSION" mkdir -p "package/$VERSION" +# Build python package tarballs +# Pip can't install these otherwise from a read-only area like /Applications +for package in DataAugmentationUtilsPackage DatasetUtilsPackage DeepSSMUtilsPackage DocumentationUtilsPackage ShapeCohortGenPackage shapeworks ; do + cd Python + tar czvf ${package}.tar.gz $package + cd .. +done + BASE_LIB=${INSTALL_DEP_DIR}/lib cp -a $INSTALL_DIR/* "package/${VERSION}" cp -a Examples "package/${VERSION}" diff --git a/Support/package_windows.sh b/Support/package_windows.sh index afb97a5578..c252fde6d9 100755 --- a/Support/package_windows.sh +++ b/Support/package_windows.sh @@ -48,7 +48,8 @@ cp -r $BUILD/bin/Release bin rm bin/*Tests.pdb bin/Recon*.pdb bin/Mesh*.pdb rm -rf Post -# Build python packages +# Build python package tarballs +# Pip can't install these otherwise from a read-only area like C:\Program Files\ShapeWorks for package in DataAugmentationUtilsPackage DatasetUtilsPackage DeepSSMUtilsPackage DocumentationUtilsPackage ShapeCohortGenPackage shapeworks ; do cd Python tar czvf ${package}.tar.gz $package diff --git a/install_shapeworks.bat b/install_shapeworks.bat index b71f3b2327..c88bead90a 100644 --- a/install_shapeworks.bat +++ b/install_shapeworks.bat @@ -48,6 +48,8 @@ call pip install Python/DocumentationUtilsPackage.tar.gz call pip install Python/DataAugmentationUtilsPackage.tar.gz call pip install Python/DeepSSMUtilsPackage.tar.gz call pip install Python/ShapeCohortGenPackage.tar.gz +call pip install Python/shapeworks.tar.gz + REM install the shapeworks python module and conda [de]activate scripts call .\Installation\install_python_module.bat diff --git a/install_shapeworks.sh b/install_shapeworks.sh index 2a72e76720..f1e82701a5 100644 --- a/install_shapeworks.sh +++ b/install_shapeworks.sh @@ -188,13 +188,14 @@ function install_conda() { if ! pip install seaborn==0.11.2; then return 1; fi if ! pip install swcc==1.0.5; then return 1; fi if ! pip install scikit-learn==1.1.1; then return 1; fi - if ! pip install Python/DatasetUtilsPackage; then return 1; fi # install the local GirderConnector code as a package - if ! pip install Python/DocumentationUtilsPackage; then return 1; fi # install shapeworks auto-documentation as a package - if ! pip install Python/DataAugmentationUtilsPackage; then return 1; fi # install data augmentation code as a package - if ! pip install Python/DeepSSMUtilsPackage; then return 1; fi # install DeepSSM code as a package - if ! pip install Python/ShapeCohortGenPackage; then return 1; fi # install shape cohort generation code as a package - + for package in DataAugmentationUtilsPackage DatasetUtilsPackage DeepSSMUtilsPackage DocumentationUtilsPackage ShapeCohortGenPackage shapeworks ; do + if [[ -e Python/${package}.tar.gz ]] ; then + if ! pip install Python/${package}.tar.gz; then return 1; fi + else + if ! pip install Python/${package}; then return 1; fi + fi + done ./Installation/install_python_module.sh # install python module ./Installation/conda_env_setup.sh # install conda [de]activate scripts