Skip to content

CodeWithCharan/virtual-env-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

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 <paste_python_3.7_path_location> 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

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published