Skip to content

Commit b6a62eb

Browse files
authored
Add virtual environment setup instructions to README (#5913)
1 parent fb19fb4 commit b6a62eb

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,50 @@ See our [architecture page](https://reflex.dev/blog/2024-03-21-reflex-architectu
3939

4040
## ⚙️ Installation
4141

42-
Open a terminal and run (Requires Python 3.10+):
43-
44-
```bash
45-
pip install reflex
46-
```
42+
**Important:** We strongly recommend using a virtual environment to ensure the `reflex` command is available in your PATH.
4743

4844
## 🥳 Create your first app
4945

50-
Installing `reflex` also installs the `reflex` command line tool.
46+
### 1. Create the project directory
5147

52-
Test that the install was successful by creating a new project. (Replace `my_app_name` with your project name):
48+
Replace `my_app_name` with your project name:
5349

5450
```bash
5551
mkdir my_app_name
5652
cd my_app_name
53+
```
54+
55+
### 2. Set up a virtual environment
56+
57+
Create and activate virtual environment
58+
59+
```bash
60+
# On Windows:
61+
python -m venv .venv
62+
.venv\Scripts\activate
63+
64+
# On macOS/Linux:
65+
python3 -m venv .venv
66+
source .venv/bin/activate
67+
```
68+
69+
### 3. Install Reflex
70+
71+
Reflex is available as a pip package (Requires Python 3.10+):
72+
73+
```bash
74+
pip install reflex
75+
```
76+
77+
### 4. Initialize the project
78+
79+
This command initializes a template app in your new directory:
80+
81+
```bash
5782
reflex init
5883
```
5984

60-
This command initializes a template app in your new directory.
85+
### 5. Run the app
6186

6287
You can run this app in development mode:
6388

@@ -69,6 +94,11 @@ You should see your app running at http://localhost:3000.
6994

7095
Now you can modify the source code in `my_app_name/my_app_name.py`. Reflex has fast refreshes so you can see your changes instantly when you save your code.
7196

97+
### Troubleshooting
98+
99+
If you installed Reflex without a virtual environment and the `reflex` command is not found, you can run commands using: `python3 -m reflex init` and `python3 -m reflex run`
100+
101+
72102
## 🫧 Example App
73103

74104
Let's go over an example: creating an image generation UI around [DALL·E](https://platform.openai.com/docs/guides/images/image-generation?context=node). For simplicity, we just call the [OpenAI API](https://platform.openai.com/docs/api-reference/authentication), but you could replace this with an ML model run locally.

0 commit comments

Comments
 (0)