In this lesson we 'll create virtual environment for our python project and install all necessary packages from pypi though cmd, which 'll used in our project.
1). Open directory where you want to create virtual environment.
2). Open cmd in same directory by clicking shift + mouse right key and then select 'open command window here'.
3). Install virtual environment by running following command in cmd. If virtual environment already installed then skip this step.
4). Type following command in cmd and press enter. It will create virtual environment.
You can see a new folder is added with name env. You can change name of virtual environment to your own choice, just change the env to Your_Own_Name in later part of command.
5). Now type this command in cmd and press enter. Virtual environment will be activated.
You can see (env) in start of line in cmd.
6). Now we 'll install all necessary package from pypi, which 'll be used in our project. Run following commands in cmd.
Now virtual environment is ready with all necessary pypi packages.
1). Open directory where you want to create virtual environment.
2). Open cmd in same directory by clicking shift + mouse right key and then select 'open command window here'.
3). Install virtual environment by running following command in cmd. If virtual environment already installed then skip this step.
pip install virtualenv
4). Type following command in cmd and press enter. It will create virtual environment.
virtualenv env
You can see a new folder is added with name env. You can change name of virtual environment to your own choice, just change the env to Your_Own_Name in later part of command.
5). Now type this command in cmd and press enter. Virtual environment will be activated.
env\scripts\activate
You can see (env) in start of line in cmd.
6). Now we 'll install all necessary package from pypi, which 'll be used in our project. Run following commands in cmd.
pip install django
pip install djangorestframework
pip install django-oauth-toolkit
pip install pymysql
pip install pythondbhelper
Now virtual environment is ready with all necessary pypi packages.