Installation#

  1. Go to Python website, download and install latest version

  2. Make sure during installation, to check the checkbox to add the Python reference in Environment variable Path

  3. Once installation is done, you can check the Python version by running command to check installation is successfull

python --version

Package manager and virtual environment#


  • To install third party python modules/packages, you can use pip as package manager, there are other ways to install python packages like poetry, conda etc…

Example:

pip install virtualenv 
  • It’s always recommended to isolate various development environments/projects from your machine by installing and working on a virtual environment.

  • To isolate, you can create a virtual environment in python and install all the packages inside it , instead of directly installing them in your machine.

# 1. Install virtualenv package
pip install virtualenv 
# 2. Create virtual env
virtualenv venv
# 3. Activate
venv\Scripts\activate
  • You can also use conda as a package manager, here is an example on how you can create a conda virtual environment.

# 1. Create conda environment
conda create --name venv
# 2. Activate
conda activate venv

Command line#


Open your command line and type Python

>python

Python 3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 100 + 56
156
>>>

Jupyter notebook#


To run jupyter notebook from command line,

  1. Install jupyter notebook package

pip install jupyter
  1. Create a folder structure where you will store all your progress and within that folder, run:

jupyter notebook

A new window would be launched in your browser, click on New to create a notebook and rename it for your reference

Google Colab#


To run jupyter notebook from google colab, you can use google colab cloud, which is free and open source.

  1. Go to https://colab.research.google.com/ from your google account

  2. Create new notebook and execute

Code editors#


To write Python code or any code, you could use PyCharm or VSCode, if you are using VSCode which has simple and intiuitive UI , you can download from https://code.visualstudio.com/

VSCode offers many features, you can also install many extensions including extensions required to run Jupyter notebooks