This guide covers the installation process for OpenAstro2 and its dependencies.
- Windows: Windows 10/11, Windows Server 2019+
- Linux: Ubuntu 18.04+, Debian 10+, CentOS 8+, other modern distributions
- macOS: macOS 10.15+ (Catalina or later)
- Python Version: 3.9 or higher
- Architecture: 64-bit (recommended)
# Install from PyPI (when available)
pip install openastro2
# Or install from source
pip install git+https://github.com/dimmastro/openastro2.git- Clone the repository:
git clone https://github.com/dimmastro/openastro2.git
cd openastro2- Install dependencies:
pip install -r requirements.txt- Install the package:
python setup.py installFor development work:
git clone https://github.com/dimmastro/openastro2.git
cd openastro2
pip install -e .If you add or edit translations under openastro2/locale/<lang>/LC_MESSAGES/openastro.po,
rebuild the .mo files with:
openastro2/scripts/update_translations.shOpenAstro2 requires the following Python packages (automatically installed with pip):
pyswisseph==2.10.3.2 # Swiss Ephemeris calculations
skyfield==1.46 # Astronomical computations
svgwrite==1.4.3 # SVG generation
pandas==2.0.2 # Data manipulation
numpy==1.26.4 # Numerical operations
pytz # Time zone handling
requests==2.31.0 # HTTP client
pydeck==0.8.0 # Geospatial visualization
openpyxl==3.1.5 # Excel file support
ephem==4.2 # Additional ephemeris
geographiclib==2.0 # Geographic calculations
certifi==2023.11.17 # SSL certificates
Some features require additional system-level packages:
sudo apt-get update
sudo apt-get install -y \
librsvg2-bin \
imagemagick \
python3-dev \
build-essentialsudo yum install -y \
librsvg2-tools \
ImageMagick \
python3-devel \
gcc \
gcc-c++# Using Homebrew
brew install librsvg imagemagick
# Using MacPorts
sudo port install librsvg2 ImageMagick- librsvg: Download from librsvg website
- ImageMagick: Download from ImageMagick website
- Ensure binaries are in your system PATH
- Install Python 3.9+ from python.org
- Install Visual C++ Build Tools (if compiling from source)
- Run installation:
py -m pip install -r requirements.txt
py setup.py installMost modern Linux distributions should work without issues:
# Ensure Python 3.9+ is installed
python3 --version
# Install system dependencies
sudo apt-get install librsvg2-bin imagemagick
# Install OpenAstro2
pip3 install -r requirements.txt
python3 setup.py install# Install Homebrew if not present
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install system dependencies
brew install python librsvg imagemagick
# Install OpenAstro2
pip3 install -r requirements.txt
python3 setup.py installCreate a test file test_installation.py:
#!/usr/bin/env python3
try:
from openastro2.openastro2 import openAstro
print("✓ OpenAstro2 imported successfully")
# Test basic functionality
event = openAstro.event("Test", 2000, 1, 1, 12, 0, 0,
timezone=0, location="London",
geolat=51.5074, geolon=-0.1278)
chart = openAstro(event, type="Radix")
print("✓ Basic chart creation successful")
# Test SVG generation
svg = chart.makeSVG2()
if '<svg' in svg and '</svg>' in svg:
print("✓ SVG generation successful")
else:
print("✗ SVG generation failed")
except ImportError as e:
print(f"✗ Import failed: {e}")
except Exception as e:
print(f"✗ Error: {e}")Run the test:
python test_installation.py# Navigate to the project directory
cd openastro2
# Run tests
python -m pytest tests/Optional environment variables:
# Swiss Ephemeris data directory (optional)
export SWISSEPH_DIR=/path/to/swiss/ephemeris/data
# Timezone database location (optional)
export TZDATA_DIR=/path/to/timezone/dataOn first run, OpenAstro2 will:
- Create configuration directory:
~/.openastro.org/ - Download Swiss Ephemeris data files (if needed)
- Initialize default settings
pip install pyswisseph==2.10.3.2Install librsvg2-bin (Linux) or librsvg (macOS/Windows)
# Use user installation
pip install --user -r requirements.txt
# Or use virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate # Windows
pip install -r requirements.txt# Clear cache and re-download
rm -rf ~/.openastro.org/swiss_ephemeris/
# Restart Python and create a chartIf you encounter issues:
- Check the troubleshooting section
- Search existing issues on GitHub
- Create a new issue with:
- Your operating system and version
- Python version
- Complete error message
- Steps to reproduce
Using a virtual environment prevents conflicts:
# Create virtual environment
python -m venv openastro2-env
# Activate it
source openastro2-env/bin/activate # Linux/macOS
# or
openastro2-env\Scripts\activate # Windows
# Install OpenAstro2
pip install -r requirements.txt
python setup.py install
# When done, deactivate
deactivateAfter successful installation:
- Read the Quick Start Guide
- Explore Examples
- Review the API Reference
- Check out Configuration Options