diff --git a/docs/faq.md b/docs/faq.md index 33379a03f..4ee02a1fd 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -8,6 +8,7 @@ This page contains answers to frequently asked questions about GaNDLF. - [Table of Contents](#table-of-contents) - [Why do I get the error `pkg_resources.DistributionNotFound: The 'GANDLF' distribution was not found`?](#why-do-i-get-the-error-pkg_resourcesdistributionnotfound-the-gandlf-distribution-was-not-found) - [Where do I start?](#where-do-i-start) + - [Why is GaNDLF not working?](#why-is-gandlf-not-working) - [Which parts of a GaNDLF configuration are customizable?](#which-parts-of-a-gandlf-configuration-are-customizable) - [Can I run GaNDLF on a high performance computing (HPC) cluster?](#can-i-run-gandlf-on-a-high-performance-computing-hpc-cluster) - [How can I track the per-epoch training performance?](#how-can-i-track-the-per-epoch-training-performance) @@ -25,6 +26,12 @@ The [usage](https://cbica.github.io/GaNDLF/usage) guide is fairly comprehensive [Back To Top ↑](#table-of-contents) +### Why is GaNDLF not working? + +Verify that [the installation](https://cbica.github.io/GaNDLF/setup) has been done correctly by running `python ./gandlf_verifyInstall` after activating the correct virtual environment. If you are still having issues, please feel free to [post a support request](https://github.com/CBICA/GaNDLF/issues/new?assignees=&labels=&template=--questions-help-support.md&title=), and we will do our best to address it ASAP. + +[Back To Top ↑](#table-of-contents) + ### Which parts of a GaNDLF configuration are customizable? Virtually all of it! For more details, please see the [usage](https://cbica.github.io/GaNDLF/usage) guide and our extensive [samples](https://github.com/CBICA/GaNDLF/tree/master/samples). All available options are documented in the [config_all_options.yaml file](https://github.com/CBICA/GaNDLF/blob/master/samples/config_all_options.yaml). diff --git a/docs/setup.md b/docs/setup.md index 05d3a5a76..c0de9e895 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -35,5 +35,5 @@ pip install -e . # conda install -c conda-forge gandlf -y ## verify installation -python -c "import GANDLF as gf;print(gf.__version__)" +python ./gandlf_verifyInstall ``` diff --git a/gandlf_verifyInstall b/gandlf_verifyInstall new file mode 100644 index 000000000..2f2abf8b0 --- /dev/null +++ b/gandlf_verifyInstall @@ -0,0 +1,46 @@ +#!usr/bin/env python +# -*- coding: utf-8 -*- + +import os, argparse +from datetime import date + + +# main function +if __name__ == "__main__": + copyrightMessage = ( + "Contact: software@cbica.upenn.edu\n\n" + + "This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) " + + str(date.today().year) + + " University of Pennsylvania. All rights reserved." + ) + + parser = argparse.ArgumentParser( + prog="GANDLF_VerifyInstall", + formatter_class=argparse.RawTextHelpFormatter, + description="Verify GaNDLF installation.\n\n" + copyrightMessage, + ) + + try: + import GANDLF as gf + + print("GaNDLF installed version:", gf.__version__) + except: + raise Exception( + "GaNDLF not properly installed, please see https://cbica.github.io/GaNDLF/setup" + ) + + try: + import GANDLF.anonymize.dicomanonymizer as anon + + if anon: + print("GANDLF's git submodules were successfully imported.") + except: + try: + os.system("git submodule update --init --recursive") + except: + print("Git was not found, please try again.") + os.system("pip install -e .") + + args = parser.parse_args() + + print("GaNDLF is ready. See https://cbica.github.io/GaNDLF/usage") diff --git a/setup.py b/setup.py index 2d8e8279b..41e13ad30 100644 --- a/setup.py +++ b/setup.py @@ -99,6 +99,7 @@ def run(self): "gandlf_patchMiner", "gandlf_preprocess", "gandlf_anonymizer", + "gandlf_verifyInstall", ], classifiers=[ "Development Status :: 3 - Alpha",