Windows and Mac Commands for development
Problem Statement: Installing virtual environment in Windows:
1. To create a file using terminal :
Syntax:
In Mac:
touch <file_name>
On Windows:
type nul > <file_name>
In Mac
touch code_improvizer.py
In windows
C:Users\leo\projects\code_improvizer> type nul > code_improviser.py
You can check the version of the virtual environment installed by typing the following
C:Usersleo> virtualenv --version
2. To create Virtual Environment navigate to the folder where you wish to create Virtual Environment and type:
Syntax: python -m virtualenv <name-of-the-virtual-environment>
or
virtualenv<name-of-the-virtual-environment>
C:Usersleocodingutilities> python -m virtualenv venv
OR
C:Usersleocodingutilities> virtualenv venv
2. To Activate the Virtual Environment type [specific to Windows (Not for MacOS)]:
Syntax: .<name-of-the-virtual-environment>Scriptsactivate.bat
or
.<name-of-the-virtual-environment>Scriptsactivate
C:Usersleocodingutilities> .venvScriptsactivate.bat
OR
C:Usersleocodingutilities> .venvScriptsactivate