-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add virtual environment setup instructions to README #5913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+38
−8
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
|
|
||
| ## ⚙️ Installation | ||
|
|
||
| Open a terminal and run (Requires Python 3.10+): | ||
|
|
||
| ```bash | ||
| pip install reflex | ||
| ``` | ||
| **Important:** We strongly recommend using a virtual environment to ensure the `reflex` command is available in your PATH. | ||
|
|
||
| ## 🥳 Create your first app | ||
|
|
||
| Installing `reflex` also installs the `reflex` command line tool. | ||
| ### 1. Create the project directory | ||
|
|
||
| Test that the install was successful by creating a new project. (Replace `my_app_name` with your project name): | ||
| Replace `my_app_name` with your project name: | ||
|
|
||
| ```bash | ||
| mkdir my_app_name | ||
| cd my_app_name | ||
| ``` | ||
|
|
||
| ### 2. Set up a virtual environment | ||
|
|
||
| Create and activate virtual environment | ||
|
|
||
| ```bash | ||
| # On Windows: | ||
| python -m venv .venv | ||
| .venv\Scripts\activate | ||
|
|
||
| # On macOS/Linux: | ||
| python3 -m venv .venv | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| ### 3. Install Reflex | ||
|
|
||
| Reflex is available as a pip package (Requires Python 3.10+): | ||
|
|
||
| ```bash | ||
| pip install reflex | ||
| ``` | ||
|
|
||
| ### 4. Initialize the project | ||
|
|
||
| This command initializes a template app in your new directory: | ||
|
|
||
| ```bash | ||
| reflex init | ||
| ``` | ||
|
|
||
| This command initializes a template app in your new directory. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This avoids repeatation |
||
| ### 5. Run the app | ||
|
|
||
| You can run this app in development mode: | ||
|
|
||
|
|
@@ -69,6 +94,11 @@ You should see your app running at http://localhost:3000. | |
|
|
||
| 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. | ||
|
|
||
| ### Troubleshooting | ||
|
|
||
| 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` | ||
|
|
||
|
|
||
| ## 🫧 Example App | ||
|
|
||
| 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. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Missing colon after "Create and activate virtual environment"
Prompt To Fix With AI