diff --git a/Getting Started/Dockerfile b/Getting Started/Dockerfile new file mode 100644 index 00000000..46aa5da7 --- /dev/null +++ b/Getting Started/Dockerfile @@ -0,0 +1,60 @@ +# ===================================================================== +# ALwrity Automated Dockerfile - Zero Manual Steps for End Users +# ===================================================================== +# This Dockerfile will automatically: +# 1. Use Python 3.11 +# 2. Install all system dependencies (build tools, Rust, etc.) +# 3. Clone the latest ALwrity code from GitHub +# 4. Install Python dependencies +# 5. Set up a non-root user +# 6. Expose Streamlit port and run the app +# ===================================================================== + +# 1. Use official Python 3.11 image +FROM python:3.11-slim as base + +# 2. Set environment variables for Python +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + +# 3. Install system dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + gcc \ + git \ + curl \ + wget \ + nano \ + libffi-dev \ + libssl-dev \ + rustc \ + cargo \ + && rm -rf /var/lib/apt/lists/* + +# 4. Set work directory +WORKDIR /app + +# 5. Clone the latest ALwrity code from GitHub +RUN git clone https://github.com/AJaySi/AI-Writer.git . + +# 6. Install Python dependencies +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt + +# 7. Create a non-root user for security +RUN useradd -m alwrityuser +USER alwrityuser + +# 8. Expose Streamlit's default port +EXPOSE 8501 + +# 9. Set environment variable for Streamlit (optional: disables telemetry) +ENV STREAMLIT_TELEMETRY=0 + +# 10. Default command: run ALwrity with Streamlit +CMD ["streamlit", "run", "alwrity.py", "--server.port=8501", "--server.address=0.0.0.0"] + +# ===================================================================== +# END OF DOCKERFILE +# ===================================================================== diff --git a/Getting Started/README.md b/Getting Started/README.md index 6cb73585..7cee0d5e 100644 --- a/Getting Started/README.md +++ b/Getting Started/README.md @@ -1,167 +1,52 @@ -## Easy Installation Guide for Content Creators +# ALwrity Installation Guide: Start Here! -### Step 1: Install Python 3.11 -1. Download Python 3.11 installer: - - Visit [Python 3.11.6 Download Page](https://www.python.org/downloads/release/python-3116/) - - Scroll down and click on "Windows installer (64-bit)" - - Save the file to your computer +Welcome to ALwrity! This guide will help you choose the best installation method for your needs, whether you're a non-technical user or a developer. Please read the options below and follow the recommended path for your system. -2. Run the installer: - - Double click the downloaded file - - ✅ IMPORTANT: Check "Add Python 3.11 to PATH" - - Click "Install Now" - - Wait for installation to complete - - Click "Close" +--- -### Step 2: Install ALwrity -1. Download this project: - - Click the green "Code" button above - - Select "Download ZIP" - - Extract the ZIP file to your desired location +## Which Installation Method Should I Use? -2. Open Command Prompt: - - Press Windows + R - - Type "cmd" and press Enter - - Navigate to the extracted folder: - ``` - cd path\to\ALwrity - ``` +### 1. **Docker (Recommended for Most Users, All Platforms)** +- **Best for:** Anyone who wants a hassle-free, one-command setup on Windows, Mac, or Linux. +- **Why choose Docker?** + - No need to install Python, Rust, or system libraries manually. + - Everything runs in a safe, isolated environment. + - Consistent experience across all operating systems. +- **How to use:** + - See [README_dockerfile.md](./README_dockerfile.md) for step-by-step instructions. -3. Run the automatic installer: - ``` - python setup.py install - ``` +### 2. **Windows One-Click Installer (`install_alwrity.bat`)** +- **Best for:** Windows users who prefer a simple double-click installer. +- **Why choose this?** + - Checks and installs all prerequisites for you (Python, Rust, Visual C++ Build Tools). + - Minimal technical knowledge required. +- **How to use:** + - See [README_install_bat.md](./README_install_bat.md) for detailed instructions. -### Troubleshooting -If you encounter any issues: -1. Make sure Python 3.11 is installed correctly: - - Open Command Prompt - - Type: `python --version` - - Should show: `Python 3.11.x` +### 3. **Manual Setup for Linux/macOS (`setup.py`)** +- **Best for:** Linux/macOS users who are comfortable with the terminal. +- **Why choose this?** + - Gives you more control over the environment. + - Useful if you want to customize or develop ALwrity. +- **How to use:** + - See [README_setup_py.md](./README_setup_py.md) for a full walkthrough. -2. Common Issues: - - If you see "Python is not recognized": Restart your computer - - If you get package errors: Run `pip install --upgrade pip` first +--- -Need help? [Open an issue](../../issues) and we'll assist you! +## Quick Decision Table +| Your System | Easiest Method | File/Guide to Use | +|---------------------|-----------------------|--------------------------| +| Windows (any) | Docker or install_alwrity.bat | README_dockerfile.md or README_install_bat.md | +| Mac | Docker | README_dockerfile.md | +| Linux | Docker | README_dockerfile.md | +| Linux/macOS (dev) | setup.py (manual) | README_setup_py.md | -## For Developers -If you're a developer or want to contribute: -```bash -# Clone the repository -git clone https://github.com/yourusername/ALwrity.git +--- -# Create virtual environment -python -m venv venv +## Still Unsure? +- If you are not sure, **Docker is the safest and easiest choice** for most users. +- If you run into any issues, check the troubleshooting sections in each guide or [open an issue on GitHub](https://github.com/AJaySi/AI-Writer/issues). -# Activate virtual environment -# On Windows: -.\venv\Scripts\activate -# On Mac/Linux: -source venv/bin/activate +--- -# Install dependencies -pip install -r requirements.txt -``` - -# ALwrity - AI Content Writing Assistant - -## Quick Start Guide for Non-Technical Users - -### Option 1: One-Click Installation (Recommended) -1. Download this project: - - Click the green "Code" button above - - Select "Download ZIP" - - Extract the ZIP file to your desired location (e.g., Desktop) - -2. Run the installer: - - Double-click `install.bat` in the extracted folder - - If Windows asks for permission, click "Yes" - - Follow the on-screen instructions - - Wait for the installation to complete - -3. Start ALwrity: - - Open Command Prompt (Windows + R, type "cmd", press Enter) - - Navigate to the ALwrity folder: - ``` - cd path\to\ALwrity - ``` - - Type `alwrity` and press Enter - -### Option 2: Manual Installation -If the one-click installer doesn't work, follow these steps: - -1. Install Python 3.11: - - Visit [Python 3.11.6 Download Page](https://www.python.org/downloads/release/python-3116/) - - Click "Windows installer (64-bit)" - - Run the installer - - ✅ IMPORTANT: Check "Add Python 3.11 to PATH" - - Click "Install Now" - - Wait for installation to complete - -2. Install ALwrity: - - Open Command Prompt (Windows + R, type "cmd", press Enter) - - Navigate to the ALwrity folder: - ``` - cd path\to\ALwrity - ``` - - Run the installation: - ``` - python setup.py install - ``` - - Follow any on-screen instructions - -3. Start ALwrity: - - In the same Command Prompt window, type: - ``` - alwrity - ``` - - Press Enter - -### Troubleshooting Guide - -#### Common Issues and Solutions: - -1. "Python is not recognized" - - Solution: Restart your computer after installing Python - - Make sure you checked "Add Python 3.11 to PATH" during installation - -2. "Visual C++ Build Tools not found" - - Solution: Run this command in an administrative PowerShell: - ``` - winget install Microsoft.VisualStudio.2022.BuildTools --silent --override "--wait --quiet --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" - ``` - -3. "Rust compiler not found" - - Solution: Run these commands in PowerShell: - ``` - Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe - ./rustup-init.exe -y - ``` - -4. Installation Errors - - Check the `install_errors.log` file in the ALwrity folder - - Share the error message with our support team - -#### Need Help? -- Open an issue on GitHub -- Join our support community -- Contact our support team - -### System Requirements -- Windows 10 or later -- Python 3.11.x -- At least 4GB RAM -- 2GB free disk space - -### First-Time Setup -After installation: -1. The first time you run ALwrity, it will ask for your API keys -2. Follow the on-screen instructions to enter your keys -3. Your keys will be saved securely for future use - -### Updating ALwrity -To update to the latest version: -1. Download the latest release -2. Run `install.bat` again -3. Follow the on-screen instructions \ No newline at end of file +Happy writing! diff --git a/Getting Started/README_dockerfile.md b/Getting Started/README_dockerfile.md new file mode 100644 index 00000000..527e285d --- /dev/null +++ b/Getting Started/README_dockerfile.md @@ -0,0 +1,68 @@ +--- + +## Using ALwrity with Docker (Recommended for All Users) + +### What is Docker? +Docker lets you run ALwrity in a safe, isolated environment on any computer (Windows, Mac, Linux) without worrying about Python or system setup. Think of it as a "ready-to-go" box for the app. + +### Step 1: Install Docker +- Go to [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/) +- Download and install Docker Desktop for your operating system (Windows/Mac) or follow the Linux instructions. +- After installation, restart your computer if prompted. +- To check Docker is working, open a terminal and run: + ``` + docker --version + ``` + You should see a version number. + +### Step 2: Build the ALwrity Docker Image (No Manual Download Needed!) +1. Open a terminal. +2. Navigate to the `Getting Started` folder in your workspace: + ``` + cd /workspaces/AI-Writer/Getting\ Started + ``` +3. Build the Docker image (this will automatically download the latest ALwrity code from GitHub): + ``` + docker build -t alwrity . + ``` + > **Note:** You do NOT need to manually download or clone the project. The Dockerfile will do this for you! + +### Step 3: Run ALwrity in Docker +1. Start the app with this command: + ``` + docker run -p 8501:8501 alwrity + ``` +2. Wait until you see a message like: + ``` + Local URL: http://localhost:8501 + ``` +3. Open your web browser and go to [http://localhost:8501](http://localhost:8501) +4. Follow the on-screen instructions to set up your API keys and start creating content! + +### Stopping ALwrity +- To stop the app, go back to the terminal and press `Ctrl+C`. + +### Advanced: Saving Your Work +- By default, any files you create inside Docker are lost when the container stops. +- To save your work to your computer, run: + ``` + docker run -p 8501:8501 -v $(pwd)/alwrity_data:/app/your_data_folder alwrity + ``` + Replace `your_data_folder` with the folder ALwrity uses for output (see documentation). + +### Troubleshooting +- If you see errors about missing ports or permissions, make sure Docker Desktop is running. +- If you get a 'permission denied' error on Linux, try running with `sudo`: + ``` + sudo docker run -p 8501:8501 alwrity + ``` +- For other issues, check the Troubleshooting section below or open an issue on GitHub. + +--- + +## Need More Help? +- Visit the [official Docker documentation](https://docs.docker.com/get-started/) +- Open an issue on our GitHub page +- Join our support community + +--- \ No newline at end of file diff --git a/Getting Started/README_install_bat.md b/Getting Started/README_install_bat.md new file mode 100644 index 00000000..0ca0a97d --- /dev/null +++ b/Getting Started/README_install_bat.md @@ -0,0 +1,248 @@ +## Easy Installation Guide for Content Creators + +### Step 1: Install Python 3.11 +1. Download Python 3.11 installer: + - Visit [Python 3.11.6 Download Page](https://www.python.org/downloads/release/python-3116/) + - Scroll down and click on "Windows installer (64-bit)" + - Save the file to your computer + +2. Run the installer: + - Double click the downloaded file + - ✅ IMPORTANT: Check "Add Python 3.11 to PATH" + - Click "Install Now" + - Wait for installation to complete + - Click "Close" + +### Step 2: Install ALwrity +1. Download this project: + - Click the green "Code" button above + - Select "Download ZIP" + - Extract the ZIP file to your desired location + +2. Open Command Prompt: + - Press Windows + R + - Type "cmd" and press Enter + - Navigate to the extracted folder: + ``` + cd path\to\ALwrity + ``` + +3. Run the automatic installer: + ``` + python setup.py install + ``` + +### Troubleshooting +If you encounter any issues: +1. Make sure Python 3.11 is installed correctly: + - Open Command Prompt + - Type: `python --version` + - Should show: `Python 3.11.x` + +2. Common Issues: + - If you see "Python is not recognized": Restart your computer + - If you get package errors: Run `pip install --upgrade pip` first + +Need help? [Open an issue](../../issues) and we'll assist you! + +## For Developers +If you're a developer or want to contribute: +```bash +# Clone the repository +git clone https://github.com/yourusername/ALwrity.git + +# Create virtual environment +python -m venv venv + +# Activate virtual environment +# On Windows: +.\venv\Scripts\activate +# On Mac/Linux: +source venv/bin/activate + +# Install dependencies +pip install -r requirements.txt +``` + +# ALwrity - AI Content Writing Assistant + +## Quick Start Guide for Non-Technical Users + +### Option 1: One-Click Installation (Recommended) +1. Download this project: + - Click the green "Code" button above + - Select "Download ZIP" + - Extract the ZIP file to your desired location (e.g., Desktop) + +2. Run the installer: + - Double-click `install.bat` in the extracted folder + - If Windows asks for permission, click "Yes" + - Follow the on-screen instructions + - Wait for the installation to complete + +3. Start ALwrity: + - Open Command Prompt (Windows + R, type "cmd", press Enter) + - Navigate to the ALwrity folder: + ``` + cd path\to\ALwrity + ``` + - Type `alwrity` and press Enter + +### Option 2: Manual Installation +If the one-click installer doesn't work, follow these steps: + +1. Install Python 3.11: + - Visit [Python 3.11.6 Download Page](https://www.python.org/downloads/release/python-3116/) + - Click "Windows installer (64-bit)" + - Run the installer + - ✅ IMPORTANT: Check "Add Python 3.11 to PATH" + - Click "Install Now" + - Wait for installation to complete + +2. Install ALwrity: + - Open Command Prompt (Windows + R, type "cmd", press Enter) + - Navigate to the ALwrity folder: + ``` + cd path\to\ALwrity + ``` + - Run the installation: + ``` + python setup.py install + ``` + - Follow any on-screen instructions + +3. Start ALwrity: + - In the same Command Prompt window, type: + ``` + alwrity + ``` + - Press Enter + +### Troubleshooting Guide + +#### Common Issues and Solutions: + +1. "Python is not recognized" + - Solution: Restart your computer after installing Python + - Make sure you checked "Add Python 3.11 to PATH" during installation + +2. "Visual C++ Build Tools not found" + - Solution: Run this command in an administrative PowerShell: + ``` + winget install Microsoft.VisualStudio.2022.BuildTools --silent --override "--wait --quiet --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" + ``` + +3. "Rust compiler not found" + - Solution: Run these commands in PowerShell: + ``` + Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe + ./rustup-init.exe -y + ``` + +4. Installation Errors + - Check the `install_errors.log` file in the ALwrity folder + - Share the error message with our support team + +#### Need Help? +- Open an issue on GitHub +- Join our support community +- Contact our support team + +### System Requirements +- Windows 10 or later +- Python 3.11.x +- At least 4GB RAM +- 2GB free disk space + +### First-Time Setup +After installation: +1. The first time you run ALwrity, it will ask for your API keys +2. Follow the on-screen instructions to enter your keys +3. Your keys will be saved securely for future use + +### Updating ALwrity +To update to the latest version: +1. Download the latest release +2. Run `install.bat` again +3. Follow the on-screen instructions + +# ALwrity Windows Installer Guide (`install_alwrity.bat`) + +--- + +## What is `install_alwrity.bat`? +`install_alwrity.bat` is a fully automated installer for ALwrity on Windows. It is designed for non-technical users and will set up everything you need with minimal input. + +--- + +## What Does It Do? +- Checks for administrator rights and guides you if not running as admin. +- Checks if Python 3.11 is installed. If not, it downloads and launches the installer for you. +- Checks for Visual C++ Build Tools and Rust compiler. If missing, it downloads and launches their installers. +- Creates a virtual environment for ALwrity. +- Activates the environment and upgrades pip. +- Installs all required Python packages and ALwrity itself. +- Shows you how to start ALwrity after installation. + +--- + +## Prerequisites +- **Windows 10 or later** +- **Internet connection** (to download Python and dependencies) +- **At least 4GB RAM** +- **2GB free disk space** + +--- + +## Step-by-Step Instructions + +### 1. Download ALwrity +- Download the ALwrity ZIP file from GitHub. +- Right-click the ZIP file and select "Extract All..." to unzip it. +- Open the extracted folder. + +### 2. Run the Installer +- Right-click `install_alwrity.bat` in the `Getting Started` folder and select "Run as administrator". +- If Windows asks for permission, click "Yes". +- Follow the on-screen instructions: + - If Python 3.11, Visual C++ Build Tools, or Rust are missing, the installer will download and launch their installers for you. Complete each installation, then re-run `install_alwrity.bat`. + - The installer will set up everything automatically. This may take a few minutes. + +### 3. Start ALwrity +- After installation, open a new Command Prompt window. +- Type: + ``` + alwrity + ``` +- Press Enter. ALwrity will start! + +--- + +## Troubleshooting +- **Not running as administrator:** + - Right-click `install_alwrity.bat` and select "Run as administrator". +- **Python not found:** + - Make sure you installed Python 3.11 and checked "Add Python 3.11 to PATH". + - Restart your computer after installing Python. +- **Permission errors:** + - Make sure you are running as administrator. +- **Other errors:** + - Take a screenshot of the error and [open an issue on GitHub](https://github.com/AJaySi/AI-Writer/issues). + +--- + +## FAQ +- **Do I need to install anything else?** + - No, `install_alwrity.bat` will handle everything for you. +- **Can I run this on Mac or Linux?** + - No, this installer is for Windows only. See the Docker or manual instructions for other systems. +- **Is it safe?** + - Yes, the script only installs ALwrity and its dependencies. + +--- + +## Need More Help? +- [Open an issue on GitHub](https://github.com/AJaySi/AI-Writer/issues) +- Join our support community + +--- diff --git a/Getting Started/README_setup_py.md b/Getting Started/README_setup_py.md new file mode 100644 index 00000000..17d1067c --- /dev/null +++ b/Getting Started/README_setup_py.md @@ -0,0 +1,92 @@ +# ALwrity Linux/macOS Installer Guide (`setup.py`) + +--- + +## What is `setup.py`? +`setup.py` is an automated installer for ALwrity on Linux and macOS. It checks your system, sets up a virtual environment, installs all dependencies, and configures ALwrity for you. + +--- + +## What Does It Do? +- Checks your Python version (must be 3.11.x) +- Checks for Rust compiler (required for some Python packages) +- Creates a Python virtual environment (`venv`) if it doesn't exist +- Activates the virtual environment (auto-activation for Linux/macOS) +- Installs all required Python packages from `requirements.txt` +- Installs ALwrity as a command-line tool +- Prints clear next steps for running ALwrity +- Logs any errors to `install_errors.log` for easy troubleshooting + +--- + +## Prerequisites +- **Linux or macOS** +- **Python 3.11.x** (install from https://www.python.org/downloads/ if needed) +- **Rust compiler** (install with `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y`) +- **At least 4GB RAM** +- **2GB free disk space** + +--- + +## Step-by-Step Instructions + +### 1. Open a Terminal +- Navigate to the ALwrity project folder: + ``` + cd /path/to/AI-Writer/Getting\ Started + ``` + +### 2. Run the Installer +- Run: + ``` + python3 setup.py install + ``` +- The script will check your system and install everything needed. +- If you see errors about Python or Rust, follow the on-screen instructions to install them, then re-run the script. + +### 3. Start ALwrity +- Activate the virtual environment: + ``` + source venv/bin/activate + ``` +- Start the app: + ``` + streamlit run alwrity.py + ``` +- Or use the command: + ``` + alwrity + ``` + +--- + +## Troubleshooting +- **Python version error:** + - Make sure you have Python 3.11.x installed and are using `python3`. +- **Rust not found:** + - Install Rust with: + ``` + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + source $HOME/.cargo/env + ``` +- **Other errors:** + - Check the `install_errors.log` file in the folder for details. + - Copy the error and [open an issue on GitHub](https://github.com/AJaySi/AI-Writer/issues). + +--- + +## FAQ +- **Do I need to install anything else?** + - No, `setup.py` will handle everything for you if prerequisites are met. +- **Can I run this on Windows?** + - Use the Windows installer (`install_alwrity.bat`) instead. +- **Is it safe?** + - Yes, the script only installs ALwrity and its dependencies. + +--- + +## Need More Help? +- [Open an issue on GitHub](https://github.com/AJaySi/AI-Writer/issues) +- Join our support community + +--- diff --git a/Getting Started/install_alwrity.bat b/Getting Started/install_alwrity.bat new file mode 100644 index 00000000..007e1d1d --- /dev/null +++ b/Getting Started/install_alwrity.bat @@ -0,0 +1,91 @@ +@echo off +:: ALwrity Automated Windows Installer +:: This script will set up ALwrity with minimal user input. +:: Last updated: April 23, 2025 + +chcp 65001 >nul +setlocal enabledelayedexpansion + +:: Welcome message +cls +echo ====================================== +echo ALwrity - One Click Windows Installer +echo ====================================== +echo. + +:: Check for admin rights +openfiles >nul 2>&1 +if %errorlevel% NEQ 0 ( + echo This installer needs to be run as administrator. + echo Please right-click and select "Run as administrator". + pause + exit /b 1 +) + +:: Check if Python 3.11 is installed +python --version 2>nul | findstr /i "3.11" >nul +if errorlevel 1 ( + echo Python 3.11 is not installed or not in PATH. + echo Downloading Python 3.11 installer... + powershell -Command "Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.11.6/python-3.11.6-amd64.exe -OutFile python-3.11.6-amd64.exe" + echo Launching Python installer. Please check 'Add Python to PATH' and complete installation. + start python-3.11.6-amd64.exe + echo After installation, please re-run this installer. + pause + exit /b 1 +) + +:: Check for Visual C++ Build Tools +where cl >nul 2>&1 +if errorlevel 1 ( + echo Visual C++ Build Tools not found. Installing... + powershell -Command "Start-Process 'powershell' -Verb runAs -ArgumentList 'winget install Microsoft.VisualStudio.2022.BuildTools --silent --override \"--wait --quiet --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended\"'" + echo Please wait for the installation to finish, then re-run this installer. + pause + exit /b 1 +) + +:: Check for Rust compiler +where rustc >nul 2>&1 +if errorlevel 1 ( + echo Rust compiler not found. Installing... + powershell -Command "Invoke-WebRequest -Uri https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe" + start rustup-init.exe -y + echo Please wait for the installation to finish, then re-run this installer. + pause + exit /b 1 +) + +:: Create virtual environment if it doesn't exist +if not exist "venv" ( + echo Creating virtual environment... + python -m venv venv +) + +:: Activate virtual environment and install requirements +echo Activating virtual environment... +call venv\Scripts\activate.bat + +:: Upgrade pip +echo Upgrading pip... +python -m pip install --upgrade pip + +:: Install requirements if requirements.txt exists +if exist requirements.txt ( + echo Installing Python dependencies... + pip install -r requirements.txt +) + +:: Install ALwrity +if exist setup.py ( + echo Installing ALwrity... + python setup.py install +) else ( + echo setup.py not found. Skipping ALwrity install step. +) + +echo. +echo Installation complete! +echo To start ALwrity, open a new command prompt and type: alwrity +echo. +pause diff --git a/Getting Started/setup.py b/Getting Started/setup.py index 7ab576a6..5edc9084 100644 --- a/Getting Started/setup.py +++ b/Getting Started/setup.py @@ -41,6 +41,11 @@ def check_system_dependencies(): print("Checking system dependencies...") all_checks_passed = True + # User message about system dependencies + print("\nNOTE: Some dependencies like Rust, Visual C++ Build Tools, or Python itself cannot be installed automatically by this script.") + print("This is because installing system-level packages requires admin rights and can differ across operating systems.") + print("For your safety and system stability, please follow the on-screen instructions to install any missing prerequisites manually.\n") + # Check Python version print("Checking Python version...") if sys.version_info < (3, 11) or sys.version_info >= (3, 12): @@ -124,6 +129,13 @@ def main(): log_error("Virtual Environment Creation", error_msg) sys.exit(1) + # Activate virtual environment automatically (Linux/macOS only) + if platform.system() != "Windows": + activate_script = os.path.join("venv", "bin", "activate_this.py") + if os.path.exists(activate_script): + with open(activate_script) as f: + exec(f.read(), {'__file__': activate_script}) + # Install requirements requirements = get_requirements() install_requirements(requirements) @@ -152,6 +164,7 @@ def main(): print(" source venv/bin/activate") print("2. Run the application:") print(" streamlit run alwrity.py") + print("\nYou can now use the 'alwrity' command as well.") if __name__ == '__main__': main() \ No newline at end of file