You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-8Lines changed: 37 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,25 +39,50 @@ See our [architecture page](https://reflex.dev/blog/2024-03-21-reflex-architectu
39
39
40
40
## ⚙️ Installation
41
41
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.
47
43
48
44
## 🥳 Create your first app
49
45
50
-
Installing `reflex` also installs the `reflex` command line tool.
46
+
### 1. Create the project directory
51
47
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:
53
49
54
50
```bash
55
51
mkdir my_app_name
56
52
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
57
82
reflex init
58
83
```
59
84
60
-
This command initializes a template app in your new directory.
85
+
### 5. Run the app
61
86
62
87
You can run this app in development mode:
63
88
@@ -69,6 +94,10 @@ You should see your app running at http://localhost:3000.
69
94
70
95
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.
71
96
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
+
72
101
## 🫧 Example App
73
102
74
103
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