Example env configuration

openclaw 中文openclaw 2

Here is a comprehensive English installation tutorial for AI OpenClaw.

Example env configuration-第1张图片-OpenClaw下载中文-AI中文智能体


AI OpenClaw - Installation Tutorial (English)

System Requirements

Before installation, ensure your system meets the following requirements:

  • Operating System: Windows 10/11, macOS 10.14+, or Linux (Ubuntu 20.04+/CentOS 8+)
  • RAM: Minimum 8GB (16GB recommended for optimal performance)
  • Storage: 10GB free space
  • Python: Version 3.8 or higher
  • Node.js: Version 16+ (required for web UI)
  • Git: Latest version

Installation Steps

Step 1: Install Prerequisites

  • Windows:
    Install Python, Node.js, and Git.
    During Python installation, check "Add Python to PATH".

  • macOS:
    Use Homebrew (if not installed, run /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"):

    brew install python node git
  • Linux (Ubuntu/Debian):

    sudo apt update
    sudo apt install python3 python3-pip nodejs npm git

Step 2: Clone the Repository

Open a terminal/command prompt and run:

git clone https://github.com/openclaw-ai/openclaw.git
cd openclaw

Step 3: Set Up Python Environment

  • Create and activate a virtual environment:

    # Windows
    python -m venv venv
    venv\Scripts\activate
    # macOS/Linux
    python3 -m venv venv
    source venv/bin/activate
  • Install Python dependencies:

    pip install -r requirements.txt

Step 4: Configure Environment Variables

Create a .env file in the project root (copy from .env.example if available):

MODEL_TYPE=claude-3-opus
LOG_LEVEL=INFO

Replace your_api_key_here with your actual AI API key (e.g., Anthropic, OpenAI).


Step 5: Install Frontend Dependencies (if applicable)

If the project includes a web interface:

cd frontend  # Navigate to frontend directory if exists
npm install
npm run build
cd ..

Step 6: Database Setup

For database-dependent features:

# Initialize database (if using SQLite)
python scripts/init_db.py
# Or for PostgreSQL/MySQL, update .env with credentials and run:
python manage.py migrate

Step 7: Verify Installation

Run the test command to verify everything works:

python -m pytest tests/ -v

Or start the basic application:

python main.py

Quick Start

  1. Launch the application:

    python main.py --mode=interactive
  2. Access Web UI (if available):

    python web_app.py

    Then open http://localhost:5000 in your browser.

  3. API Usage:

    curl -X POST http://localhost:8000/api/process \
         -H "Content-Type: application/json" \
         -d '{"input": "Hello, OpenClaw!"}'

Troubleshooting

Issue Solution
ModuleNotFoundError Run pip install -r requirements.txt again
Port already in use Change port in .env or use --port flag
API key errors Verify key in .env matches your AI provider
Node.js version issues Update Node.js: nvm install 18 && nvm use 18

Upgrading

To update to the latest version:

git pull origin main
pip install --upgrade -r requirements.txt

Get Help


Notes:

  • Keep your API keys secure and never commit .env to version control
  • Regular updates recommended for security patches
  • GPU acceleration available for supported models (see docs for CUDA setup)

Enjoy using AI OpenClaw! 🦞🚀

标签: example env configuration

抱歉,评论功能暂时关闭!