https://github.com/codewithcharan/virtual-env-setup
https://github.com/codewithcharan/virtual-env-setup
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codewithcharan/virtual-env-setup
- Owner: CodeWithCharan
- Created: 2024-01-24T11:17:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T17:01:37.000Z (almost 2 years ago)
- Last Synced: 2025-02-08T17:44:52.072Z (over 1 year ago)
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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

### 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
```