This guide covers the installation of the cognitive-computing package and its dependencies.
- Requirements
- Quick Install
- Development Installation
- Optional Dependencies
- Platform-Specific Instructions
- Verifying Installation
- Troubleshooting
- Uninstallation
- Python 3.8 or higher is required
- Python 3.9-3.11 recommended for best compatibility
The following packages are automatically installed:
numpy >= 1.21.0- Numerical computingscipy >= 1.7.0- Scientific computingscikit-learn >= 1.0.0- Machine learning utilitiesmatplotlib >= 3.4.0- Plotting and visualizationseaborn >= 0.11.0- Statistical visualizationtqdm >= 4.62.0- Progress barsjoblib >= 1.1.0- Parallel processing
- Memory: Minimum 4GB RAM (8GB+ recommended for large-scale SDM)
- Storage: ~100MB for package and dependencies
- OS: Windows, macOS, or Linux
pip install cognitive-computing# Clone the repository
git clone https://github.com/cognitive-computing/cognitive-computing.git
cd cognitive-computing
# Install in standard mode
pip install .# Install in editable/development mode
pip install -e .For contributing to the package or running tests:
# Clone the repository
git clone https://github.com/cognitive-computing/cognitive-computing.git
cd cognitive-computing
# Create a virtual environment (recommended)
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install with all development dependencies
pip install -e ".[dev]"The [dev] extra includes:
pytest >= 7.0.0- Testing frameworkpytest-cov >= 3.0.0- Test coverageblack >= 22.0.0- Code formattingflake8 >= 4.0.0- Lintingmypy >= 0.990- Type checkingsphinx >= 4.0.0- Documentationsphinx-rtd-theme >= 1.0.0- Documentation themejupyter >= 1.0.0- Jupyter notebooksipython >= 8.0.0- Interactive Python
For additional visualization capabilities:
pip install -e ".[viz]"Includes:
plotly >= 5.0.0- Interactive 3D visualizationsnetworkx >= 2.6.0- Network analysisgraphviz >= 0.19.0- Graph visualization
For GPU-accelerated operations:
pip install -e ".[gpu]"Includes:
cupy >= 10.0.0- CUDA accelerationtorch >= 1.10.0- PyTorch for neural operations
Note: GPU dependencies require appropriate CUDA installation.
pip install -e ".[dev,viz,gpu]"- Install Python: Download from python.org
- Install Visual C++ Build Tools (for some dependencies):
# May be required for packages like scipy # Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
- Install package:
pip install cognitive-computing
- Install Python (if not using system Python):
# Using Homebrew brew install python@3.9 - Install package:
pip install cognitive-computing
- Install Python and dependencies:
sudo apt-get update sudo apt-get install python3.9 python3.9-dev python3-pip
- Install package:
pip install cognitive-computing
If using Anaconda or Miniconda:
# Create new environment
conda create -n cognitive python=3.9
# Activate environment
conda activate cognitive
# Install package
pip install cognitive-computing
# Or install some dependencies via conda
conda install numpy scipy matplotlib scikit-learn
pip install cognitive-computing# Test basic import
import cognitive_computing
print(cognitive_computing.__version__)
# Test SDM import
from cognitive_computing.sdm import create_sdm
sdm = create_sdm(dimension=1000)
print(f"Created SDM with {sdm.config.num_hard_locations} locations")# Run all tests
pytest
# Run specific module tests
pytest tests/test_sdm/
# Run with coverage report
pytest --cov=cognitive_computing --cov-report=html# Check visualization support
try:
import plotly
print("Plotly installed: Interactive visualizations available")
except ImportError:
print("Plotly not installed: Install with pip install cognitive-computing[viz]")
# Check GPU support
try:
import cupy
print("CuPy installed: GPU acceleration available")
except ImportError:
print("CuPy not installed: Install with pip install cognitive-computing[gpu]")Solution: Ensure you're in the correct directory and the package is installed:
pip list | grep cognitive-computingSolution: Update NumPy to the required version:
pip install --upgrade numpy>=1.21.0Solution: Reduce the number of hard locations or use a machine with more RAM:
# Instead of
sdm = create_sdm(dimension=10000)
# Use smaller configuration
from cognitive_computing.sdm import SDMConfig, SDM
config = SDMConfig(dimension=5000, num_hard_locations=1000)
sdm = SDM(config)Solution: Set the backend explicitly:
import matplotlib
matplotlib.use('Agg') # For headless environments
# or
matplotlib.use('TkAgg') # For interactive useSolution: Use --user flag or virtual environment:
pip install --user cognitive-computingIf you encounter issues:
- Check the GitHub Issues
- Search the documentation
- Create a new issue with:
- Python version:
python --version - Package version:
pip show cognitive-computing - Error message and traceback
- Minimal reproducible example
- Python version:
pip uninstall cognitive-computing# Save current environment
pip freeze > requirements-backup.txt
# Uninstall package and dependencies
pip uninstall cognitive-computing
pip uninstall -r requirements.txt# Clear pip cache
pip cache purge
# Clear Python cache
find . -type d -name __pycache__ -exec rm -r {} +
find . -type f -name "*.pyc" -deleteAfter installation:
- Read the Quick Start Guide
- Explore the SDM Overview
- Try the Examples
- Check the API Reference
For contributors:
- Fork the repository
- Clone your fork
- Install in development mode with all extras
- Create a feature branch
- Make changes and add tests
- Run tests and linting
- Submit a pull request
See Contributing Guide for detailed instructions.