Installation
Set up Python, JDK, and install SolverForge.
Prerequisites
SolverForge requires:
- Python 3.10 or higher (3.11 or 3.12 recommended)
- JDK 17 or higher (for the optimization engine backend)
Check Python Version
python --version
# Python 3.11.0 or higher
If you need to install Python, visit python.org or use your system’s package manager.
Check JDK Version
java -version
# openjdk version "17.0.x" or higher
If you need to install a JDK:
- macOS:
brew install openjdk@17 - Ubuntu/Debian:
sudo apt install openjdk-17-jdk - Fedora:
sudo dnf install java-17-openjdk - Windows: Download from Adoptium or Oracle
Make sure JAVA_HOME is set:
echo $JAVA_HOME
# Should output path to JDK installation
Install SolverForge
Using pip (Recommended)
pip install solverforge-legacy
In a Virtual Environment
# Create virtual environment
python -m venv .venv
# Activate it
source .venv/bin/activate # Linux/macOS
# or
.venv\Scripts\activate # Windows
# Install SolverForge
pip install solverforge-legacy
Verify Installation
python -c "from solverforge_legacy.solver import SolverFactory; print('SolverForge installed successfully!')"
Project Setup
For a new project, create a pyproject.toml:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "my-solver-project"
version = "1.0.0"
requires-python = ">=3.10"
dependencies = [
"solverforge-legacy == 1.24.1",
"pytest == 8.2.2", # For testing
]
Then install your project in development mode:
pip install -e .
IDE Setup
VS Code
Install the Python extension and configure your interpreter to use the virtual environment.
PyCharm
- Open your project
- Go to Settings > Project > Python Interpreter
- Select the virtual environment interpreter
Troubleshooting
JVM Not Found
If you see errors about JVM not found:
- Verify Java is installed:
java -version - Set
JAVA_HOMEenvironment variable - Ensure
JAVA_HOME/binis in yourPATH
Import Errors
If imports fail:
- Verify you’re in the correct virtual environment
- Re-install:
pip install --force-reinstall solverforge-legacy
Memory Issues
For large problems, you may need to increase JVM memory. This is configured automatically, but you can adjust if needed.
Next Steps
Now that SolverForge is installed, follow the Hello World Tutorial to build your first solver.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.