Installation Issues
Solutions for common installation and environment setup problems
Table of Contents
- Overview
- Conda Environment Issues
- Python Package Issues
- GPU/CUDA Issues
- Dependency Conflicts
- Path and Import Issues
- Workspace Setup Issues
- See Also
Overview
Installation issues typically fall into these categories:
| Category | Symptoms | Common Causes |
|---|---|---|
| Conda | Environment creation fails | Dependency conflicts, channel issues |
| Packages | Import errors | Missing packages, version mismatches |
| GPU | CUDA errors, slow performance | Driver issues, PyTorch configuration |
| Paths | Module not found | PYTHONPATH, working directory |
| Workspace | Permission errors | Directory permissions, missing folders |
Conda Environment Issues
Environment Creation Fails
Symptom:
ResolvePackageNotFound:
- package_name=version
Solutions:
- Update conda:
conda update -n base conda - Clear cache and retry:
conda clean --all conda env create -f environment.yml - Use mamba for faster resolution:
conda install -n base mamba mamba env create -f environment.yml - Create minimal environment and install manually:
conda create -n OHMind python=3.10 conda activate OHMind pip install -r requirements.txt # If available
Environment Activation Fails
Symptom:
EnvironmentNameNotFound: Could not find conda environment: OHMind
Solutions:
- List available environments:
conda env list - Check if environment was created:
conda info --envs - Recreate if missing:
conda env create -f environment.yml
Slow Environment Creation
Symptom: Environment creation takes very long (>30 minutes)
Solutions:
- Use mamba:
conda install -n base mamba mamba env create -f environment.yml - Use libmamba solver:
conda install -n base conda-libmamba-solver conda config --set solver libmamba conda env create -f environment.yml
Python Package Issues
Import Errors
Symptom:
ModuleNotFoundError: No module named 'langchain'
Solutions:
- Verify environment is activated:
conda activate OHMind which python # Should point to OHMind env - Install missing package:
pip install langchain langchain-core langgraph - Check package is installed:
pip show langchain
RDKit Import Fails
Symptom:
ImportError: cannot import name 'Chem' from 'rdkit'
Solutions:
- Install RDKit via conda:
conda install -c conda-forge rdkit - Verify installation:
python -c "from rdkit import Chem; print('RDKit OK')"
PyTorch Import Fails
Symptom:
ImportError: libcudart.so.XX.X: cannot open shared object file
Solutions:
- Install CPU-only PyTorch:
pip install torch --index-url https://download.pytorch.org/whl/cpu - Install CUDA-compatible PyTorch:
# For CUDA 11.8 pip install torch --index-url https://download.pytorch.org/whl/cu118 # For CUDA 12.1 pip install torch --index-url https://download.pytorch.org/whl/cu121
Version Mismatch Errors
Symptom:
TypeError: __init__() got an unexpected keyword argument 'xxx'
Solutions:
- Check package versions:
pip show langchain langchain-core langgraph - Install specific versions:
pip install langchain==0.2.0 langchain-core==0.2.0 langgraph==0.1.0 - Upgrade all related packages:
pip install --upgrade langchain langchain-core langgraph langchain-openai
GPU/CUDA Issues
CUDA Not Available
Symptom:
>>> import torch
>>> torch.cuda.is_available()
False
Solutions:
- Check NVIDIA driver:
nvidia-smi - Check CUDA version:
nvcc --version - Install matching PyTorch:
# Check your CUDA version first nvidia-smi | grep "CUDA Version" # Install matching PyTorch pip install torch --index-url https://download.pytorch.org/whl/cu118
Out of Memory (OOM)
Symptom:
RuntimeError: CUDA out of memory
Solutions:
-
Reduce batch size in VAE operations
- Clear GPU cache:
import torch torch.cuda.empty_cache() - Use CPU for inference:
device = "cpu" # Instead of "cuda"
Wrong GPU Selected
Symptom: Using wrong GPU or GPU 0 when another is preferred
Solutions:
- Set CUDA_VISIBLE_DEVICES:
export CUDA_VISIBLE_DEVICES=1 # Use GPU 1 - Set in Python:
import os os.environ["CUDA_VISIBLE_DEVICES"] = "1"
Dependency Conflicts
Conflicting Package Versions
Symptom:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.
Solutions:
- Create fresh environment:
conda deactivate conda env remove -n OHMind conda env create -f environment.yml - Use pip-tools for resolution:
pip install pip-tools pip-compile requirements.in pip-sync requirements.txt
Pydantic Version Issues
Symptom:
pydantic.errors.PydanticUserError: `xxx` is not a valid Pydantic field type
Solutions:
- Check Pydantic version:
pip show pydantic - Install compatible version:
pip install "pydantic>=2.0,<3.0"
LangChain Compatibility
Symptom: Various LangChain-related errors after upgrade
Solutions:
- Pin compatible versions:
pip install langchain==0.2.16 langchain-core==0.2.38 langgraph==0.2.28 - Check migration guide:
- LangChain has breaking changes between major versions
- Consult the LangChain migration documentation
Path and Import Issues
Module Not Found
Symptom:
ModuleNotFoundError: No module named 'OHMind'
Solutions:
- Set PYTHONPATH:
export PYTHONPATH="/path/to/OHMind:$PYTHONPATH" - Add to .env file:
PYTHONPATH=/path/to/OHMind - Install in development mode:
cd /path/to/OHMind pip install -e .
Wrong Python Interpreter
Symptom: Commands work in terminal but not in scripts
Solutions:
- Check which Python:
which python # Should show: /path/to/anaconda3/envs/OHMind/bin/python - Use full path in scripts:
/path/to/anaconda3/envs/OHMind/bin/python script.py - Activate environment in script:
#!/bin/bash source /path/to/anaconda3/etc/profile.d/conda.sh conda activate OHMind python script.py
Import Order Issues
Symptom: Import works sometimes but not always
Solutions:
-
Check for circular imports
-
Ensure proper package structure:
OHMind/ ├── __init__.py ├── OHVAE/ │ └── __init__.py └── OHPSO/ └── __init__.py
Workspace Setup Issues
Permission Denied
Symptom:
PermissionError: [Errno 13] Permission denied: '/OHMind_workspace/HEM'
Solutions:
- Create workspace with correct permissions:
mkdir -p "$OHMind_workspace" chmod 755 "$OHMind_workspace" - Create subdirectories:
mkdir -p "$OHMind_workspace"/{HEM,QM,MD,Multiwfn} chmod 755 "$OHMind_workspace"/{HEM,QM,MD,Multiwfn} - Check ownership:
ls -la "$OHMind_workspace" # Change owner if needed sudo chown -R $USER:$USER "$OHMind_workspace"
Directory Not Found
Symptom:
FileNotFoundError: [Errno 2] No such file or directory: '/OHMind_workspace/HEM'
Solutions:
- Set environment variable:
export OHMind_workspace="/path/to/workspace" - Create directories:
mkdir -p "$OHMind_workspace"/{HEM,QM,MD,Multiwfn} - Add to .env:
OHMind_workspace=/path/to/workspace HEM_SAVE_PATH=${OHMind_workspace}/HEM QM_WORK_DIR=${OHMind_workspace}/QM MD_WORK_DIR=${OHMind_workspace}/MD MULTIWFN_WORK_DIR=${OHMind_workspace}/Multiwfn
Disk Space Issues
Symptom:
OSError: [Errno 28] No space left on device
Solutions:
- Check disk space:
df -h "$OHMind_workspace" - Clean old results:
# Remove old QM temp files find "$QM_WORK_DIR" -name "temp_*" -mtime +7 -exec rm -rf {} \; # Remove old MD trajectories find "$MD_WORK_DIR" -name "*.xtc" -mtime +30 -exec rm {} \; - Move workspace to larger disk:
export OHMind_workspace="/mnt/large_disk/OHMind_workspace"
Quick Verification Script
#!/bin/bash
# verify_installation.sh
echo "=== OHMind Installation Verification ==="
# Check conda environment
echo -n "Conda environment: "
if [ "$CONDA_DEFAULT_ENV" = "OHMind" ]; then
echo "✅ OHMind"
else
echo "❌ Not in OHMind environment (current: $CONDA_DEFAULT_ENV)"
fi
# Check Python version
echo -n "Python version: "
python_version=$(python --version 2>&1)
if [[ "$python_version" == *"3.10"* ]] || [[ "$python_version" == *"3.11"* ]]; then
echo "✅ $python_version"
else
echo "⚠️ $python_version (recommended: 3.10+)"
fi
# Check key packages
echo "Key packages:"
for pkg in langchain langgraph rdkit torch pydantic fastapi; do
if python -c "import $pkg" 2>/dev/null; then
version=$(pip show $pkg 2>/dev/null | grep Version | cut -d' ' -f2)
echo " ✅ $pkg ($version)"
else
echo " ❌ $pkg (not installed)"
fi
done
# Check PYTHONPATH
echo -n "PYTHONPATH includes OHMind: "
if python -c "import OHMind" 2>/dev/null; then
echo "✅"
else
echo "❌ (set PYTHONPATH or install OHMind)"
fi
# Check workspace
echo -n "Workspace: "
if [ -d "$OHMind_workspace" ] && [ -w "$OHMind_workspace" ]; then
echo "✅ $OHMind_workspace"
else
echo "❌ Not configured or not writable"
fi
echo "=== Verification Complete ==="
See Also
- Troubleshooting Overview - Main troubleshooting guide
- MCP Issues - Server connection problems
- Quick Start Guide - Initial setup
- Installation Guide - Detailed installation
| *Last updated: 2025-12-23 | OHMind v0.1.0* |