This guide will help you set up your computational environment for the Materials Informatics course. We'll install SMACT, Chemeleon, and all necessary dependencies.
- SMACT: The core toolkit for materials screening and structure prediction
- Chemeleon: AI-powered crystal structure generation tool
- Jupyter: For running interactive notebooks
- Supporting Libraries: NumPy, SciPy, pymatgen, pandas, and visualisation tools
- Development Tools: Pre-commit hooks for code quality (optional)
- Python 3.9 or higher (3.11 recommended)
- Git for cloning repositories
- ~2GB free disk space for libraries and models
- Internet connection for downloading packages and pretrained models
We provide scripts that handle the entire setup process:
# Make the script executable
chmod +x setup.sh
# Run the setup
./setup.sh# Run the setup script
setup.batThese scripts will:
- Create a virtual environment called
smact-env - Install all required packages
- Clone and install SMACT
- Set up pre-commit hooks
- Verify the installation
If you prefer to install manually or the automatic setup fails:
# Create the environment
python -m venv smact-env
# Activate it
# On Unix/Mac:
source smact-env/bin/activate
# On Windows:
smact-env\Scripts\activate# Upgrade pip
pip install --upgrade pip
# Install requirements
pip install -r requirements.txt# Clone the repository
git clone https://github.com/WMD-group/SMACT.git
# Install in development mode
cd SMACT
pip install -e .
cd ..# Clone the repository
git clone https://github.com/hspark1212/chemeleon-dng.git
# Install
cd chemeleon-dng
pip install -e .
cd ..# Install pre-commit hooks for code quality
pre-commit installRun the following commands to ensure everything is installed correctly:
# Check SMACT
python -c "import smact; print(f'SMACT {smact.__version__} installed successfully')"
# Check key dependencies
python -c "import numpy, pandas, pymatgen, jupyter; print('All core dependencies installed')"
# Check if Chemeleon is available
python -c "try: import chemeleon_dng; print('Chemeleon installed successfully')
except: print('Chemeleon not installed (optional)')"Some notebooks use data from the Materials Project. To access this data:
- Register for a free account at materialsproject.org
- Get your API key from your dashboard
- Save it to
assets/files/mp_api_key.txtor set it as an environment variable:export MP_API_KEY="your-key-here" # Unix/Mac set MP_API_KEY=your-key-here # Windows
Once setup is complete, you can start Jupyter:
# Make sure your virtual environment is activated
jupyter notebook
# Or use JupyterLab
jupyter labNavigate to any of the course notebooks and start learning!
1. Python Version Issues
- Ensure you have Python 3.9+ by running
python --version - On some systems, you may need to use
python3instead ofpython
2. pip Installation Failures
- Try upgrading pip:
pip install --upgrade pip - On Mac, you might need Xcode tools:
xcode-select --install - On Windows, you might need Visual C++ Build Tools
3. Import Errors
- Make sure your virtual environment is activated
- Try reinstalling the package that's failing to import
4. Chemeleon Model Download Issues
- The first run will download pretrained model checkpoints (~500MB)
- Ensure you have a stable internet connection
- Models are cached after first download
5. Memory Issues
- Some operations require 4GB+ RAM
- Close other applications if needed
- Use Google Colab for resource-intensive notebooks
If you have installation issues or limited computational resources, most notebooks can run on Google Colab:
- Upload the notebook to Google Colab
- Run the setup cell (included in each notebook)
- Upload any required data files when prompted
If you encounter issues:
- Check the error message carefully - it often contains the solution
- Search for the error online - many Python errors have known solutions
- Review the SMACT documentation
- Open an issue on the course repository with:
- Your operating system
- Python version
- The full error message
- Steps you've tried
After successful setup:
- Test your installation by running the first notebook in "Combinatorial Explosion"
- Familiarise yourself with Jupyter notebooks if needed
- Review the course overview to understand the learning path
Happy materials discovery!