Skip to content

Instantly share code, notes, and snippets.

@sambatlim
Last active June 25, 2023 16:53
Show Gist options
  • Save sambatlim/19f755134254ef8423f1783aeea474a5 to your computer and use it in GitHub Desktop.
Save sambatlim/19f755134254ef8423f1783aeea474a5 to your computer and use it in GitHub Desktop.
This is the snippet command to create virtual environment and install the requirement.txt in python [For windows].

*Requirement

If you never install virtual environment before, you need to have virtual env install.

py -m pip install --user virtualenv

Get started

$ cd <# your project folder name #>
$ py -m venv env <# (it will create the new folder in your repository called env). #>
$ ./env/Scripts/activate <# (it will activate the virtual environment). #>
$ deactivate <# (to deactivate the virtual environment). #>

Install the requirements.txt

$ pip install -r requirements.txt
<# in case pip not work you can try out pip3 as below.  #>
$ pip3 install -r requirements.txt

Create the requirements.txt

$ pip freeze > requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment