|
| 1 | +# Installation Guide |
| 2 | + |
| 3 | +This guide walks you through downloading, installing, and verifying Standalone Python on your Linux system. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [System Requirements](#system-requirements) |
| 8 | +- [Quick Start](#quick-start) |
| 9 | +- [Download](#download) |
| 10 | +- [Installation](#installation) |
| 11 | +- [Verification](#verification) |
| 12 | +- [Directory Structure](#directory-structure) |
| 13 | +- [Multiple Versions](#multiple-versions) |
| 14 | +- [Uninstallation](#uninstallation) |
| 15 | + |
| 16 | +## System Requirements |
| 17 | + |
| 18 | +### Minimum Requirements |
| 19 | + |
| 20 | +- **Operating System**: Any Linux distribution (kernel 2.6.32 or later) |
| 21 | +- **Architecture**: x86_64 (64-bit) or x86 (32-bit) |
| 22 | +- **Disk Space**: ~200MB per Python installation |
| 23 | +- **RAM**: 128MB minimum (512MB recommended) |
| 24 | +- **Temporary Space**: 50MB in `/tmp` for runtime files |
| 25 | + |
| 26 | +### Key Features |
| 27 | + |
| 28 | +✅ **No GLIBC dependency** - Works on any Linux regardless of libc version |
| 29 | +✅ **No root required** - Can be installed in user space |
| 30 | +✅ **Fully relocatable** - Move the installation anywhere |
| 31 | +✅ **Self-contained** - All dependencies included |
| 32 | + |
| 33 | +## Quick Start |
| 34 | + |
| 35 | +For the impatient, here's the fastest way to get started: |
| 36 | + |
| 37 | +```bash |
| 38 | +# Download the latest release (Python 3.12 for x86_64) |
| 39 | +wget https://github.com/your-repo/standalone-python/releases/latest/download/release-3.12-x86_64.tar.gz |
| 40 | + |
| 41 | +# Extract the archive |
| 42 | +tar -xzf release-3.12-x86_64.tar.gz |
| 43 | + |
| 44 | +# Run Python |
| 45 | +./opt/python/bin/python --version |
| 46 | +``` |
| 47 | + |
| 48 | +That's it! You now have a working Python installation. |
| 49 | + |
| 50 | +## Download |
| 51 | + |
| 52 | +### Official Releases |
| 53 | + |
| 54 | +Download pre-built releases from our GitHub releases page. Choose the appropriate version for your system: |
| 55 | + |
| 56 | +#### Python 3.12 (Latest) |
| 57 | +- [release-3.12-x86_64.tar.gz](https://github.com/your-repo/standalone-python/releases/latest) - 64-bit Linux |
| 58 | +- [release-3.12-x86.tar.gz](https://github.com/your-repo/standalone-python/releases/latest) - 32-bit Linux |
| 59 | + |
| 60 | +#### Python 3.11 |
| 61 | +- [release-3.11-x86_64.tar.gz](https://github.com/your-repo/standalone-python/releases/latest) - 64-bit Linux |
| 62 | +- [release-3.11-x86.tar.gz](https://github.com/your-repo/standalone-python/releases/latest) - 32-bit Linux |
| 63 | + |
| 64 | +#### Python 3.10 |
| 65 | +- [release-3.10-x86_64.tar.gz](https://github.com/your-repo/standalone-python/releases/latest) - 64-bit Linux |
| 66 | +- [release-3.10-x86.tar.gz](https://github.com/your-repo/standalone-python/releases/latest) - 32-bit Linux |
| 67 | + |
| 68 | +### Choosing the Right Version |
| 69 | + |
| 70 | +1. **Check your architecture**: |
| 71 | + ```bash |
| 72 | + uname -m |
| 73 | + ``` |
| 74 | + - `x86_64` → Use x86_64 version |
| 75 | + - `i386`, `i686` → Use x86 version |
| 76 | + |
| 77 | +2. **Python version selection**: |
| 78 | + - **3.12** - Latest features, best performance |
| 79 | + - **3.11** - Stable, widely compatible |
| 80 | + - **3.10** - LTS, maximum compatibility |
| 81 | + |
| 82 | +### Download via Command Line |
| 83 | + |
| 84 | +```bash |
| 85 | +# Using wget |
| 86 | +wget https://github.com/your-repo/standalone-python/releases/latest/download/release-3.12-x86_64.tar.gz |
| 87 | + |
| 88 | +# Using curl |
| 89 | +curl -LO https://github.com/your-repo/standalone-python/releases/latest/download/release-3.12-x86_64.tar.gz |
| 90 | +``` |
| 91 | + |
| 92 | +### Verify Download Integrity |
| 93 | + |
| 94 | +Always verify the downloaded file: |
| 95 | + |
| 96 | +```bash |
| 97 | +# Check file size (should be ~50-70MB) |
| 98 | +ls -lh release-*.tar.gz |
| 99 | + |
| 100 | +# Extract and test |
| 101 | +tar -tzf release-3.12-x86_64.tar.gz > /dev/null && echo "Archive OK" || echo "Archive corrupted" |
| 102 | +``` |
| 103 | + |
| 104 | +## Installation |
| 105 | + |
| 106 | +### Standard Installation |
| 107 | + |
| 108 | +1. **Create installation directory** (optional): |
| 109 | + ```bash |
| 110 | + mkdir -p ~/standalone-python |
| 111 | + cd ~/standalone-python |
| 112 | + ``` |
| 113 | + |
| 114 | +2. **Extract the archive**: |
| 115 | + ```bash |
| 116 | + tar -xzf /path/to/release-3.12-x86_64.tar.gz |
| 117 | + ``` |
| 118 | + |
| 119 | +3. **Verify the installation**: |
| 120 | + ```bash |
| 121 | + ./opt/python/bin/python --version |
| 122 | + # Output: Python 3.12.3 |
| 123 | + ``` |
| 124 | + |
| 125 | +### System-Wide Installation (requires root) |
| 126 | + |
| 127 | +To make Standalone Python available system-wide: |
| 128 | + |
| 129 | +```bash |
| 130 | +# Extract to /usr/local |
| 131 | +sudo tar -xzf release-3.12-x86_64.tar.gz -C /usr/local/ |
| 132 | + |
| 133 | +# Create symbolic links |
| 134 | +sudo ln -s /usr/local/opt/python/bin/python /usr/local/bin/standalone-python |
| 135 | +sudo ln -s /usr/local/opt/python/bin/pip /usr/local/bin/standalone-pip |
| 136 | + |
| 137 | +# Test the installation |
| 138 | +standalone-python --version |
| 139 | +``` |
| 140 | + |
| 141 | +### User Installation (no root required) |
| 142 | + |
| 143 | +Install in your home directory: |
| 144 | + |
| 145 | +```bash |
| 146 | +# Extract to home directory |
| 147 | +cd ~ |
| 148 | +tar -xzf /path/to/release-3.12-x86_64.tar.gz |
| 149 | + |
| 150 | +# Add to PATH (add to ~/.bashrc for persistence) |
| 151 | +export PATH="$HOME/opt/python/bin:$PATH" |
| 152 | + |
| 153 | +# Test the installation |
| 154 | +python --version |
| 155 | +``` |
| 156 | + |
| 157 | +### Custom Installation Location |
| 158 | + |
| 159 | +You can install Standalone Python anywhere: |
| 160 | + |
| 161 | +```bash |
| 162 | +# Extract to custom location |
| 163 | +mkdir -p /my/custom/path |
| 164 | +tar -xzf release-3.12-x86_64.tar.gz -C /my/custom/path/ |
| 165 | + |
| 166 | +# Run from custom location |
| 167 | +/my/custom/path/opt/python/bin/python --version |
| 168 | +``` |
| 169 | + |
| 170 | +## Verification |
| 171 | + |
| 172 | +### Basic Verification |
| 173 | + |
| 174 | +Verify your installation is working correctly: |
| 175 | + |
| 176 | +```bash |
| 177 | +# Check Python version |
| 178 | +./opt/python/bin/python --version |
| 179 | + |
| 180 | +# Run a simple Python command |
| 181 | +./opt/python/bin/python -c "print('Hello from Standalone Python!')" |
| 182 | + |
| 183 | +# Check pip |
| 184 | +./opt/python/bin/pip --version |
| 185 | + |
| 186 | +# List installed packages |
| 187 | +./opt/python/bin/pip list |
| 188 | +``` |
| 189 | + |
| 190 | +### Complete Verification |
| 191 | + |
| 192 | +Run comprehensive tests: |
| 193 | + |
| 194 | +```bash |
| 195 | +# Test Python interpreter |
| 196 | +./opt/python/bin/python -c " |
| 197 | +import sys |
| 198 | +import platform |
| 199 | +print(f'Python: {sys.version}') |
| 200 | +print(f'Platform: {platform.platform()}') |
| 201 | +print(f'Machine: {platform.machine()}') |
| 202 | +" |
| 203 | + |
| 204 | +# Test standard library imports |
| 205 | +./opt/python/bin/python -c " |
| 206 | +import os, sys, json, sqlite3, ssl, urllib.request |
| 207 | +print('Standard library: OK') |
| 208 | +" |
| 209 | + |
| 210 | +# Test pip functionality |
| 211 | +./opt/python/bin/pip list --format=json > /dev/null && echo "pip: OK" |
| 212 | +``` |
| 213 | + |
| 214 | +### Verify Portability |
| 215 | + |
| 216 | +Test that the installation is truly portable: |
| 217 | + |
| 218 | +```bash |
| 219 | +# Move the installation |
| 220 | +mv opt /tmp/test-python |
| 221 | + |
| 222 | +# Run from new location |
| 223 | +/tmp/test-python/python/bin/python --version |
| 224 | + |
| 225 | +# Move it back |
| 226 | +mv /tmp/test-python opt |
| 227 | +``` |
| 228 | + |
| 229 | +## Directory Structure |
| 230 | + |
| 231 | +After extraction, you'll have the following structure: |
| 232 | + |
| 233 | +``` |
| 234 | +opt/ |
| 235 | +└── python/ |
| 236 | + ├── bin/ # Executable files |
| 237 | + │ ├── python # Python wrapper script |
| 238 | + │ ├── python3 # Symlink to python |
| 239 | + │ ├── python3.12-real # Actual Python binary |
| 240 | + │ ├── pip # Pip wrapper script |
| 241 | + │ └── pip3.12-real # Actual pip binary |
| 242 | + ├── include/ # Header files |
| 243 | + ├── lib/ # Python standard library |
| 244 | + │ └── python3.12/ |
| 245 | + │ ├── site-packages/ # Installed packages |
| 246 | + │ └── ... |
| 247 | + └── shared_libraries/ # Bundled dependencies |
| 248 | + └── lib/ |
| 249 | + ├── libc.so # Musl libc |
| 250 | + └── ... # Other shared libraries |
| 251 | +``` |
| 252 | + |
| 253 | +### Important Files |
| 254 | + |
| 255 | +- `bin/python` - Main Python executable (wrapper) |
| 256 | +- `bin/pip` - Package installer (wrapper) |
| 257 | +- `lib/python3.12/` - Standard library |
| 258 | +- `lib/python3.12/site-packages/` - Installed packages location |
| 259 | +- `shared_libraries/lib/` - All bundled dependencies |
| 260 | + |
| 261 | +## Multiple Versions |
| 262 | + |
| 263 | +You can install multiple Python versions side by side: |
| 264 | + |
| 265 | +```bash |
| 266 | +# Install Python 3.12 |
| 267 | +tar -xzf release-3.12-x86_64.tar.gz -C ~/python312/ |
| 268 | + |
| 269 | +# Install Python 3.11 |
| 270 | +tar -xzf release-3.11-x86_64.tar.gz -C ~/python311/ |
| 271 | + |
| 272 | +# Use specific versions |
| 273 | +~/python312/opt/python/bin/python --version # Python 3.12.3 |
| 274 | +~/python311/opt/python/bin/python --version # Python 3.11.9 |
| 275 | +``` |
| 276 | + |
| 277 | +### Managing Multiple Versions |
| 278 | + |
| 279 | +Create aliases for convenience: |
| 280 | + |
| 281 | +```bash |
| 282 | +# Add to ~/.bashrc |
| 283 | +alias python312='~/python312/opt/python/bin/python' |
| 284 | +alias python311='~/python311/opt/python/bin/python' |
| 285 | +alias pip312='~/python312/opt/python/bin/pip' |
| 286 | +alias pip311='~/python311/opt/python/bin/pip' |
| 287 | + |
| 288 | +# Use the aliases |
| 289 | +python312 script.py |
| 290 | +pip312 install requests |
| 291 | +``` |
| 292 | + |
| 293 | +## Uninstallation |
| 294 | + |
| 295 | +Standalone Python doesn't modify your system, so uninstallation is simple: |
| 296 | + |
| 297 | +### Remove the Installation |
| 298 | + |
| 299 | +```bash |
| 300 | +# Remove the extracted directory |
| 301 | +rm -rf /path/to/opt |
| 302 | + |
| 303 | +# If you created symbolic links |
| 304 | +sudo rm /usr/local/bin/standalone-python |
| 305 | +sudo rm /usr/local/bin/standalone-pip |
| 306 | +``` |
| 307 | + |
| 308 | +### Clean Temporary Files |
| 309 | + |
| 310 | +Standalone Python creates a temporary file for the musl interpreter: |
| 311 | + |
| 312 | +```bash |
| 313 | +# Remove temporary musl interpreter (recreated on next run) |
| 314 | +rm -f /tmp/StAnDaLoNeMuSlInTeRpReTeR-musl-*.so |
| 315 | +``` |
| 316 | + |
| 317 | +### Remove from PATH |
| 318 | + |
| 319 | +If you added it to your PATH, remove the relevant lines from: |
| 320 | +- `~/.bashrc` |
| 321 | +- `~/.profile` |
| 322 | +- `~/.bash_profile` |
| 323 | + |
| 324 | +## Troubleshooting Installation |
| 325 | + |
| 326 | +### Common Issues |
| 327 | + |
| 328 | +**Archive extraction fails** |
| 329 | +```bash |
| 330 | +# Ensure you have enough disk space |
| 331 | +df -h . |
| 332 | + |
| 333 | +# Check archive integrity |
| 334 | +tar -tzf release-*.tar.gz > /dev/null |
| 335 | +``` |
| 336 | + |
| 337 | +**Permission denied errors** |
| 338 | +```bash |
| 339 | +# Ensure execute permissions |
| 340 | +chmod +x opt/python/bin/* |
| 341 | +``` |
| 342 | + |
| 343 | +**Wrong architecture** |
| 344 | +```bash |
| 345 | +# Verify your system architecture matches the download |
| 346 | +uname -m |
| 347 | +file opt/python/bin/python3.12-real |
| 348 | +``` |
| 349 | + |
| 350 | +For more troubleshooting, see [TROUBLESHOOTING.md](TROUBLESHOOTING.md). |
| 351 | + |
| 352 | +## Next Steps |
| 353 | + |
| 354 | +- Learn how to use Standalone Python: [USAGE.md](USAGE.md) |
| 355 | +- Understand the architecture: [ARCHITECTURE.md](ARCHITECTURE.md) |
| 356 | +- Build your own version: [BUILD.md](BUILD.md) |
| 357 | +- Read the FAQ: [FAQ.md](FAQ.md) |
| 358 | + |
| 359 | +--- |
| 360 | + |
| 361 | +*For additional help, please refer to our [Troubleshooting Guide](TROUBLESHOOTING.md) or open an issue on GitHub.* |
0 commit comments