@@ -62,45 +62,44 @@ await stagehand.agent.execute("book a reservation for 2 people for a trip to the
62
62
63
63
## Installation
64
64
65
- ** Recommended:** Install using ` uv ` (fast Python package manager):
65
+ ### Creating a Virtual Environment (Recommended)
66
+
67
+ First, create and activate a virtual environment to keep your project dependencies isolated:
66
68
67
69
``` bash
68
- uv add stagehand
70
+ # Create a virtual environment
71
+ python -m venv stagehand-env
72
+
73
+ # Activate the environment
74
+ # On macOS/Linux:
75
+ source stagehand-env/bin/activate
76
+ # On Windows:
77
+ stagehand-env\S cripts\a ctivate
69
78
```
70
79
71
- Alternatively, install via pip:
80
+ ### Install Stagehand
72
81
82
+ ** Normal Installation:**
73
83
``` bash
74
84
pip install stagehand
75
85
```
76
86
77
- ### Installing with uv
78
-
79
- [ uv] ( https://github.com/astral-sh/uv ) is a fast Python package installer and resolver. If you don't have uv installed, you can install it with:
87
+ ** Local Development Installation:**
88
+ If you're contributing to Stagehand or want to modify the source code:
80
89
81
90
``` bash
82
- # On macOS and Linux
83
- curl -LsSf https://astral.sh/uv/install.sh | sh
91
+ # Clone the repository
92
+ git clone https://github.com/browserbase/stagehand-python.git
93
+ cd stagehand-python
84
94
85
- # On Windows
86
- powershell -c " irm https://astral.sh/uv/install.ps1 | iex"
87
-
88
- # Or via pip
89
- pip install uv
90
- ```
91
-
92
- For new projects, you can create a new project with uv:
93
-
94
- ``` bash
95
- uv init stagehand-project
96
- cd stagehand-project
97
- uv add stagehand
95
+ # Install in editable mode with development dependencies
96
+ pip install -e .[dev]
98
97
```
99
98
100
99
## Requirements
101
100
102
101
- Python 3.9+
103
- - All dependencies are automatically handled when installing via ` uv ` or ` pip `
102
+ - All dependencies are automatically handled when installing via ` pip `
104
103
105
104
The main dependencies include:
106
105
- httpx (for async HTTP client)
@@ -112,17 +111,11 @@ The main dependencies include:
112
111
113
112
### Development Dependencies
114
113
115
- For development, install with dev dependencies:
116
-
117
- ``` bash
118
- uv add stagehand --dev
119
- ```
120
-
121
- Or install dev dependencies separately:
122
-
123
- ``` bash
124
- uv add --dev pytest pytest-asyncio pytest-mock pytest-cov black isort mypy ruff rich
125
- ```
114
+ The development dependencies are automatically installed when using ` pip install -e .[dev] ` and include:
115
+ - pytest, pytest-asyncio, pytest-mock, pytest-cov (testing)
116
+ - black, isort, ruff (code formatting and linting)
117
+ - mypy (type checking)
118
+ - rich (enhanced terminal output)
126
119
127
120
## Environment Variables
128
121
0 commit comments