Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/codewithcharan/virtual-env-setup


https://github.com/codewithcharan/virtual-env-setup

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Virtual Environment Set Up

### 1. Create a virtual environment for the default version:

```
python -m venv yourenv
```

(Or)

### Create a virtual environment for the specific Python version:

```
virtualenv -p yourenv
```

### 2. Activate the virtual environment:

- In Command Prompt (CMD):
```
yourenv\Scripts\activate.bat
```

- In PowerShell:
```
yourenv\Scripts\Activate.ps1
```

- In Linux:
```
$ source mlopsenv/Scripts/activate
```

## 3. Install ipykernel
```
pip install ipykernel
```

### 4. Set jupyter kernel for the virtual environment

```
ipython kernel install --user --name=yourenv
```

### 5. Select the installed kernel when you want to use jupyter notebook in this virtual environment

![image](https://github.com/CodeWithCharan/virtual-env-setup/assets/106027109/aca431ae-b861-447a-97c6-08a181681fb9)

### 6. If you want to freeze your requirements (optional):
```
pip3 freeze > requirements.txt # Python3
pip freeze > requirements.txt # Python2
```

### 7. If you no longer need the kernel you can uninstall it (optional):

```
jupyter-kernelspec uninstall yourenv
```