Loading...
Searching...
No Matches
Installing the Python Wrapper

The Squidstat API provides a Python wrapper, which can be downloaded from the Admiral Instruments GitHub page. The Python wrapper gives access to all the functiosn of the Squidstat API in Python.

Mac ARM64 (Apple Silicon)

If you are using a newer Mac with an ARM64 processor (M1, M2, etc.), you must perform additional steps to set up the Squidstat API.

  1. Open the cloned repository in a Finder window and navigate down a level to ./SquidstatLibrary.
    • In this folder you should see Linux, mac, windows, and mac.tar.gz.
  2. Delete the mac directory. It contains the library for Intel-based Mac processors.
  3. Extract the tar file by double clicking mac.tar.gz in the Finder window.
    • You should see a new mac/ directory get automatically created.
  4. At this point, your build environment is set up, and you can proceed normally.

Linux

If you are on a device running Linux, before using the API, run sudo ./SquidstatLibrary/Linux/install_dependencies.sh from the root directory of the SquidstatAPI. This will install all dependencies and configuration files needed to run the API.
Note: This will run apt-get update && sudo apt-get upgrade -y which will update all packages currently installed on your device.

How To Use The SquidstatLibrary with Python

  1. To use the SquidstatPyLibrary, you need to install a Python version ≥ 3.9 and ≤ 3.12.
    • Visit the official Python website at https://www.python.org/downloads/.
    • Download the installer for the desired Python version (≥ 3.9 and ≤ 3.12).
    • Run the installer and follow the installation wizard's instructions.
    • Make sure to select the option to add Python to the system environment (PATH) variables during the installation process. This will enable you to run Python from any location on your computer.
  2. Make sure you have installed Python correctly by checking the Python version using the python -V command.
  3. Now you can choose to install the library in either the global environment or a virtual environment. If you want to install the library in the global environment, you can skip this step.
    • If you prefer using a Python virtual environment, you can create one by running the command: python -m venv VIRTUAL_ENVIRONMENT_NAME
    • Open the command prompt and activate the virtual environment by typing: ./VIRTUAL_ENVIRONMENT_NAME/Scripts/activate.bat
  4. Now you can proceed to install the SquidstatPyLibrary. Download the .whl file from here. After downloading, you can install it using the command pip install YOUR_DOWNLOADED_FILE.whl
  5. Now, let's run an example script. If you have an Experiment.py file that you created to run an experiment, you can execute it by using the command python Experiment.py.

The necessary Python library files are also located inside the pythonWrapper directory.

Check out the Guided Examples for help getting started.