Skip to content

Instantly share code, notes, and snippets.

@shanto268
Last active March 15, 2024 04:10
Show Gist options
  • Save shanto268/3d58fbc7e1b1d90e0597d4ac54254409 to your computer and use it in GitHub Desktop.
Save shanto268/3d58fbc7e1b1d90e0597d4ac54254409 to your computer and use it in GitHub Desktop.
Install SQuADDS on a fresh conda environment on Mac/Linux

Installing SQuADDS on a Fresh Mac/Linux Conda Environment

Create a shell script with the following content. This allows a local development environment for SQuADDS.

#!/bin/bash

# Ensure script fails if any command fails
set -e

# Step 1: Download environment.yml from Qiskit-Metal repository
echo "Downloading environment.yml..."
curl -O https://raw.githubusercontent.com/Qiskit/qiskit-metal/main/environment.yml

# Step 2: Set up Miniconda environment
echo "Setting up Conda environment..."
conda env list
conda remove --name qiskit-metal-env --all --yes || true
conda env create -n qiskit-metal-env -f environment.yml
echo "Conda environment created."

# Activate the Conda environment
source "$(conda info --base)/etc/profile.d/conda.sh"
conda activate qiskit-metal-env

# Step 3: Install Qiskit-Metal
echo "Installing Qiskit-Metal..."
python -m pip install --no-deps -e git+https://github.com/Qiskit/qiskit-metal.git#egg=qiskit-metal

# Step 4: Install SQuADDS and its dependencies
echo "Installing SQuADDS and dependencies..."
# Clone the repository
git clone https://github.com/LFL-Lab/SQuADDS.git
cd SQuADDS
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .

If on an M1+ macOS, open your terminal in Rosetta mode.

  1. Ensure you have a .env file (at root of SQuADDS) with the following content:
# .env
GROUP_NAME=
PI_NAME=
INSTITUTION=
USER_NAME=
CONTRIB_MISC=
HUGGINGFACE_API_KEY=
GITHUB_TOKEN=
  1. Update the path to your .env file in the script.

  2. Give the script execute permissions (i.e. chmod +x it) and run it - ./your_script_name.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment