Skip to content

Installation Guide

This guide will walk you through the process of installing Browser-Use and setting up the necessary dependencies to get started with AI-powered browser automation.

System Requirements

  • Python: Python 3.11 or higher is required
  • Operating System: Windows, macOS, or Linux
  • Memory: At least 4GB RAM recommended (more for vision-enabled models)
  • Disk Space: At least 500MB for Browser-Use and its dependencies

Installation Steps

1. Install Browser-Use Package

You can install Browser-Use using pip. There are two installation options depending on your needs:

Basic Installation

If you only need the core functionality:

bash
pip install browser-use

Installation with Memory Support

If you need memory capabilities for complex multi-step tasks (requires Python < 3.13):

bash
pip install "browser-use[memory]"

2. Install Browser Engine

Browser-Use depends on Playwright for browser automation. You need to install a browser engine:

bash
patchright install chromium --with-deps --no-shell

This command installs Chromium and all necessary dependencies for browser automation.

Alternative Browser Engines

If you prefer to use a different browser engine, you can install Firefox or WebKit instead:

bash
patchright install firefox --with-deps --no-shell
patchright install webkit --with-deps --no-shell

3. Set Up Environment Variables

Browser-Use requires an API key for a language model provider. Create a .env file in your project directory with the appropriate API key:

# For OpenAI
OPENAI_API_KEY=your_api_key_here

For other language model providers, add the corresponding API key:

# For other providers
ANTHROPIC_API_KEY=your_api_key_here
GEMINI_API_KEY=your_api_key_here
DEEPSEEK_API_KEY=your_api_key_here

4. Install Additional Requirements

For some advanced features, you may need additional packages:

For Computer Vision Support

If you plan to use vision-enabled language models:

bash
pip install "browser-use[vision]"

For Development

If you're contributing to the Browser-Use project:

bash
pip install -e ".[dev]"

Verifying Your Installation

To verify that Browser-Use is correctly installed and configured:

  1. Create a simple test file called test_browser_use.py:
python
import asyncio
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
from browser_use import Agent

# Load environment variables from .env file
load_dotenv()

async def main():
    # Create a simple agent
    agent = Agent(
        task="Go to example.com and tell me the title of the page",
        llm=ChatOpenAI(model="gpt-4o", temperature=0.0)
    )
    
    # Run the agent
    result = await agent.run()
    print(f"Result: {result}")

if __name__ == "__main__":
    asyncio.run(main())
  1. Run the test file:
bash
python test_browser_use.py

If everything is set up correctly, you should see a browser window open, navigate to example.com, and then print out the title of the page.

Troubleshooting

If you encounter issues during installation or execution, check the following:

  • Ensure you have the correct Python version installed (3.11+)
  • Verify that your API keys are correctly set in the .env file
  • Check that the browser engine was installed successfully
  • For memory issues, ensure you're using Python < 3.13

For more detailed troubleshooting information, see our Debugging & Troubleshooting guide in the Advanced Usage section.