Installation#
Check Your Version of Python#
SmartEM Decisions requires Python 3.12 or later for optimal performance and access to modern typing features. You can check your current Python version by entering the following command in a terminal:
python3 --version
Note: The project specifically requires Python 3.12+ to utilise advanced typing features and maintain compatibility with the latest scientific computing libraries.
Create a Virtual Environment#
It is strongly recommended that you install SmartEM Decisions within a virtual environment to prevent conflicts with existing Python installations and maintain a clean development environment:
python3 -m venv /path/to/venv
source /path/to/venv/bin/activate
For development work, consider creating the virtual environment within the project directory:
python3 -m venv .venv
source .venv/bin/activate
Installing the Library#
Standard Installation#
You can install the library and its core dependencies using pip
:
python3 -m pip install smartem-decisions
Development Installation#
For development work or if you require the latest features, install directly from the source repository:
# Clone and install in development mode
git clone https://github.com/DiamondLightSource/smartem-decisions.git
cd smartem-decisions
pip install -e .[all]
Installation with Optional Dependencies#
Install with specific feature sets:
# Install with MCP (Model Context Protocol) support
pip install -e .[mcp]
# Install with all optional dependencies (recommended for development)
pip install -e .[all]
Verify Installation#
The library should now be installed with the command-line interface available on your system path. Verify the installation by checking the installed version:
smartem-decisions --version
You can also verify that all components are correctly installed by running:
# Test core functionality
python -c "import smartem_backend, smartem_agent, smartem_common; print('✅ Core components imported successfully')"
# Test MCP functionality (if installed with MCP support)
python -c "import smartem_mcp; print('✅ MCP components available')"
Next Steps#
Once installation is complete, you can proceed to: