12
How to create Virtual Environment in Python and Launching Jupyter notebook from there in Windows
A Virtual Environment is a python environment, that is an isolated working copy of Python which allows you to work on a specific project without affecting other projects
So basically it is a tool that enables multiple side-by-side installations of Python, one for each project.I always try to make things simple so just chill and follow these simple steps .
I assume python is already installed in your system .
So basically it is a tool that enables multiple side-by-side installations of Python, one for each project.I always try to make things simple so just chill and follow these simple steps .
I assume python is already installed in your system .
1- Open Anaconda Prompt from start menu .
2- Install virtualenv using below command .
2- Install virtualenv using below command .
> pip install virtualenv
3- Now create a new directory( new path ) for creating your new
virtual environment .
virtual environment .
a. Open Anaconda Prompt and type below command :
> mkdir newproject
You can give any name to your new directory,I have named it
newproject
newproject
b. Now enter your new directory .Enter below command :
> cd newproject

c. Now in this directory , this line below will create a
virtualenvironment there:
virtualenvironment there:
> virtualenv sentiment
My virtual environment name is sentiment, you can give any cool name .Wow! your new virtual environment is created and you can start fresh python project from there .
Now , how to use this virtual environment .
Now , how to use this virtual environment .
d. Now activate the virtual environment :
> sentiment\Scripts\activate
e. Now install the modules which you need for your project . For
ex, to install flask run the below command:
ex, to install flask run the below command:
>pip install flask
4- Now to launch jupyter notebook with this new environment.
Whenever you want to work on your project, follow below steps.
Whenever you want to work on your project, follow below steps.
a. Open Anaconda Prompt from start menu .
b. Go to the directory where you installed virtual environment.
Like, in the above case type cd newproject
c. Once in the desired directory type command -
b. Go to the directory where you installed virtual environment.
Like, in the above case type cd newproject
c. Once in the desired directory type command -
>jupyter notebook
Wow! fresh jupyter notebook opens without the load ,hassle and interference of your previous projects .Here, you can import python modules and upload files for your new project .