Installation#

This guide provides instructions to install and set up the InsightSolver API client on your local machine.

Prerequisites#

  • Python 3.9 or higher: Ensure Python is installed on your system. You can check your Python version with:

python --version
  • pip: Python’s package installer, which is typically included with Python 3 installations.

Installation Steps#

You can install the InsightSolver API client in different ways, depending on your setup:

  1. Install directly using pip (100% CLI)

    If you have git installed and don’t need a local copy of the repository, run:

    pip install git+https://github.com/insightsolver/insightsolver.git
    
  2. Clone the repository and install locally (100% CLI)

    If you have git installed and want to also keep a local copy of the repository, run:

    git clone https://github.com/insightsolver/insightsolver.git
    cd insightsolver
    pip install .
    
  3. Download via browser and install (50% GUI + 50% CLI)

    If you don’t have git installed, follow these steps:

    • Open a browser and go to insightsolver/insightsolver.

    • Click on the green button <> Code v and select Download ZIP.

    • Extract the ZIP file to a folder on your machine.

    • Open a terminal and navigate to the extracted folder using:

      cd path/to/unzipped-folder
      
    • Then install the package with:

      pip install .
      

Warning for Anaconda users: When using a virtual environment managed by Anaconda, the installation of the insightsolver library as specified above could install dependencies (specified in the file requirements.txt) via pip that are not handled by Anaconda. There are two options available. The first option is to do as specified above, which lets pip install dependencies, but risk that the virtual environment is no longer handled by Anaconda. The second option is to add a --no-deps flag to the pip install, e.g. pip install --no-deps .. This last command would install the scripts of the insightsolver module without installing the dependencies. This prevents breaking the Anaconda environment but could result in insightsolver not finding all the required dependencies at runtime. These required dependencies should therefore either be installed manually from within the Anaconda application or either using the environment.yml file.

Testing the Installation#

To verify that the installation was successful, you can run a quick test in Python to ensure all dependencies are correctly installed and functioning.

  1. Open a terminal and start a Python interpreter by typing:

    python
    
  2. Once inside the Python shell, try importing the InsightSolver class with the following command:

    from insightsolver import InsightSolver
    
  3. If the installation was successful, there should be no errors, and the Python shell should return to the prompt. If you encounter an ImportError, ensure that you have installed the package in the correct environment.

  4. Exit the Python shell by typing:

    quit()
    

If you encounter any errors or need assistance, please refer to the Help section.