Saturday, June 25, 2016

How To:Create virtual python environment and Install pypi packages in window env

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.


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.

1 comment:


  1. If you are going to invest in new web site design Massachusetts then you must put in place some key measurement tools so that you can track how your prospects interact with it.
    Going live with a Massachusetts website design without considering the implications first is like building a beautiful new house with no driveway, no front gate and no front door! In other words no one will find it or be able to get in when they do!
    See more: web site design Massachusetts

    ReplyDelete