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:
pip install browser-useInstallation with Memory Support
If you need memory capabilities for complex multi-step tasks (requires Python < 3.13):
pip install "browser-use[memory]"2. Install Browser Engine
Browser-Use depends on Playwright for browser automation. You need to install a browser engine:
patchright install chromium --with-deps --no-shellThis 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:
patchright install firefox --with-deps --no-shell
patchright install webkit --with-deps --no-shell3. 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_hereFor 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_here4. 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:
pip install "browser-use[vision]"For Development
If you're contributing to the Browser-Use project:
pip install -e ".[dev]"Verifying Your Installation
To verify that Browser-Use is correctly installed and configured:
- Create a simple test file called
test_browser_use.py:
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())- Run the test file:
python test_browser_use.pyIf 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
.envfile - 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.