File size: 2,242 Bytes
2de8395
1f1f2d8
 
 
 
2de8395
 
1f1f2d8
2de8395
1f1f2d8
2de8395
 
b42d649
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
title: Conformity Protein Dynamics
emoji: 🧬🪬
colorFrom: indigo
colorTo: purple
sdk: gradio
app_file: app.py
pinned: true
license: mit
short_description: 'use the ESM3 model to predict protein structures'
---

To create a virtual environment on a Windows machine and run your Gradio app (`app.py`) after installing the dependencies listed in `requirements.txt`, follow these steps:

### 1. **Open a Command Prompt or PowerShell window**

- Press `Windows + R`, type `cmd`, and hit Enter.
- Alternatively, search for "PowerShell" and open it.

### 2. **Navigate to your project directory**

Use the `cd` command to change directories to where your `app.py` and `requirements.txt` are located:

```bash
cd path\to\your\project
```

For example, if your project is located in `C:\Users\YourUser\projects\my-gradio-app`, you would run:

```bash
cd C:\Users\YourUser\projects\my-gradio-app
```

### 3. **Create a virtual environment**

Run the following command to create a virtual environment called `venv`:

```bash
python -m venv venv
```

This will create a folder called `venv` that contains the virtual environment.

### 4. **Activate the virtual environment**

To activate the virtual environment, run:

- On **Command Prompt**:

    ```bash
    venv\Scripts\activate
    ```

- On **PowerShell**:

    ```bash
    .\venv\Scripts\Activate
    ```

After activation, your prompt should change to show `(venv)` indicating that the virtual environment is active.

### 5. **Install the required packages**

Now that the virtual environment is activated, install the dependencies from `requirements.txt`:

```bash
pip install -r requirements.txt
```

This will install all the packages listed in `requirements.txt` within your virtual environment.

### 6. **Run your Gradio app**

Once the installation is complete, you can run your Gradio app by executing:

```bash
python app.py
```

Your Gradio app should now be running, and you can open the provided URL (typically `http://127.0.0.1:7860`) in your browser to access it.

### 7. **Deactivate the virtual environment**

When you're done, you can deactivate the virtual environment by running:

```bash
deactivate
```

This will return you to your system's default Python environment.