Installation
This guide will help you install the DesignSafe API (dapi) package and set up your environment.
Requirements
- Python: 3.10 or higher
- Operating System: Windows, macOS, or Linux
- DesignSafe Account: Required for authentication (sign up here)
Installation Methods
📦 Install from PyPI (Recommended)
The easiest way to install dapi is using pip:
🔄 Install Latest Development Version
To get the latest features and bug fixes:
🛠️ Install for Development
If you want to contribute to dapi or modify the source code:
# Clone the repository
git clone https://github.com/DesignSafe-CI/dapi.git
cd dapi
# Install Poetry (if not already installed)
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies and dapi in editable mode
virtualenv env && source env/bin/activate
poetry install
You can also install an editable local version of dapi
🏗️ DesignSafe Jupyter Environment
Installing on DesignSafe Jupyter Hub
If you're using DesignSafe Jupyter, install dapi in your notebook:
# Remove any previous installations (optional)
!pip uninstall dapi -y
# Install the latest version
!pip install dapi --quiet
# Restart kernel after installation
# Kernel >> Restart Kernel (in Jupyter menu)
Kernel Restart Required
After installing dapi in a Jupyter notebook, you must restart the kernel for the changes to take effect. Go to Kernel → Restart Kernel in the Jupyter menu.
Persistent Installation
For a persistent installation across Jupyter sessions:
🔧 Dependencies
dapi automatically installs the following key dependencies:
- tapipy: TAPIS v3 Python SDK
- pandas: Data manipulation and analysis
- sqlalchemy: Database connections
- pymysql: MySQL database connector
- tqdm: Progress bars
- python-dotenv: Environment variable management
✅ Verify Installation
Test your installation by importing dapi:
import dapi
print(f"dapi version: {dapi.__version__}")
# List available functions
print("Available functions:")
print(dir(dapi))
Expected output:
🐍 Python Environment Management
Using Virtual Environments
It's recommended to use virtual environments to avoid conflicts:
# Create virtual environment
python -m venv dapi-env
# Activate (Linux/macOS)
source dapi-env/bin/activate
# Activate (Windows)
dapi-env\Scripts\activate
# Install dapi
pip install dapi
Using Conda
# Create conda environment
conda create -n dapi-env python=3.10
# Activate environment
conda activate dapi-env
# Install dapi
pip install dapi
🚨 Troubleshooting
Common Installation Issues
Permission Errors
If you encounter permission errors:
SSL Certificate Errors
If you encounter SSL issues:
Version Conflicts
If you have conflicting dependencies:
Platform-Specific Issues
Windows
- Ensure you have Microsoft Visual C++ Build Tools installed
- Use Anaconda/Miniconda for easier dependency management
macOS
- Install Xcode Command Line Tools:
xcode-select --install
- Consider using Homebrew for Python:
brew install python
Linux
- Install development packages:
sudo apt-get install python3-dev build-essential
🔄 Updating
Update to Latest Version
Check Current Version
🆘 Getting Help
If you encounter issues during installation:
- Check the Issues page for known problems
- Search existing issues before creating a new one
- Provide details when reporting issues:
- Operating system and version
- Python version
- Complete error messages
- Installation method used
➡️ Next Steps
After successful installation:
- Set up authentication with your DesignSafe credentials
- Try the quick start guide for your first dapi workflow
- Explore examples to see dapi in action