Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
57 views

Lab Manual Day 1 Python Installation

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Lab Manual Day 1 Python Installation

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

LAB MANUAL

DAY :1
Session : 1
Objective of Lab:
To download the Software Development Environment available setup the development
environment.
Software Resources:
1. Python
2. Anaconda
3. Jupyter notebook
4. Visual Studio Code
-----------------------------------------------------------------------------------------------------------------
1. Python:

Python is a versatile, high-level programming language known for its simplicity and
readability. Python's rich ecosystem of libraries like NumPy, Pandas, and TensorFlow
empowers developers to tackle diverse tasks efficiently. Regardless of your operating system,
you can download an appropriate version of Python from the official site.

Many PCs and Macs will have python already installed.

To check if you have python installed on a Windows PC, search in the start bar for Python or
run the following on the Command Line (cmd.exe):
python --version

If you find Python is not installed, install it using the following instructions.

Installing or updating Python on your computer is the first step to programming in Python.
There are multiple installation methods, such as installing Python using an installer or a
source code (.zip file)

Download the latest version of Python from https://www.python.org/downloads/ . Once


you’ve downloaded the installer as per the operating system, Next run an installer by
double-clicking on the downloaded file and following the steps.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


After installation is completed, we will get a setup successfully install message.

Let’s open the command line or terminal and type the below command to check the version
of Python.

python --version

2. Anaconda:
Anaconda is an open-source software that contains Jupyter, spyder, etc that are used for
large data processing, data analytics, heavy scientific computing. Anaconda works for R and
python programming language.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


Download and install Anaconda:
Head over to https://www.anaconda.com/products/distribution and install the latest
version of Anaconda. Make sure to download the “Python 3.7 Version” for the appropriate
architecture.
Begin with the installation process:
Getting Started:
Begin with the installation process:

Getting Started:

Getting through the License Agreement:

Select Installation Type: Select Just Me if you want the software to be used by a single User

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


Installation-Type

Choose Installation Location:

Advanced Installation Option:

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


Getting through the Installation Process:

Recommendation to Install Pycharm:

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


Finishing up the Installation:

Working with Anaconda:


Once the installation process is done, Anaconda can be used to perform multiple
operations. To begin using Anaconda, search for Anaconda Navigator from the Start Menu
in Windows
Anaconda-Navigator-Search

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


Anaconda-Navigator-Window

Create an Environment to Run Jupyter Notebook


This is optional but recommended to create an environment before you proceed. This gives
complete segregation of different package installs for different projects you would be
working on. If you already have an environment, you can use it too.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


select + Create icon at the bottom of the screen to create an Anaconda environment.

3. Jupyter Notebook:
It is an interactive web UI environment to create notebook documents for python, R
languages. Jupyter Notebook documents take statements similar to REPL additionally it
also provides code completion, plots, and rich media.
Install and Run Jupyter Notebook
Once you create the anaconda environment, go back to the Home page on Anaconda
Navigator and install Jupyter Notebook from an application on the right panel.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


It will take a few seconds to install Jupyter to your environment, once the install completes,
you can open Jupyter from the same screen or by accessing Anaconda Navigator ->
Environments -> your environment (mine pandas-tutorial) -> select Open With Jupyter
Notebook.

This opens up Jupyter Notebook in the default browser.

Now select New -> PythonX and enter the below lines and select Run. On Jupyter, each
cell is a statement, so you can run each cell independently when there are no
dependencies on previous cells.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


This completes installing Anaconda and running Jupyter Notebook.

4. Visual Studio Code


Visual Studio Code is a lightweight source code editor. The Visual Studio Code is often called
VS Code. The VS Code runs on your desktop. It’s available for Windows, macOS, and Linux.
VS Code comes with many features such as IntelliSense, code editing, and extensions that
allow you to edit Python source code effectively. The best part is that the VS Code is open-
source and free.
Besides the desktop version, VS Code also has a browser version that you can use directly in
your web browser without installing it.
Setting up Visual Studio Code
To set up the VS Code, you follow these steps:
Step 1: To install VS Code we need to download it’s installer, to download go to VS Code
downloads page.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


Step 2: Click on blue download button based on the operating system you use. As I use
windows I will click on windows download button and it will start download vs code
installer.

After the download finishes, click on the vs code installer and it will start the setup
Step 3: It will ask you to accept their agreement, you can read it if you want and make sure
you agree and click on next.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


Step 4: Next it will ask you to choose additional tasks, choose everything and click on next.

Step 5: Then it will show ready to install, so click on the install button and It will take around
a minute to install vs code on your machine.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


After installation it will show you vs code setup completed, click on finish and it will open VS
Code.
So we sucessfully installed vs code. Now let’s setup it for python use.

Setting Up VS Code For Python


To setup python in vs code we will install a extension which will help us in writing python
code and also configure the python interpreter in vs code.
1. Install Python Extension
Open VS Code, click on the extensions tab or use ctrl+shift+x to open the extensions section,
search for python, the first result will display extension named Python by microsoft click on
it and install the extension.

Along with python extension it will install some other additional extensions so it will take
some time also make sure you are connected to the internet.
2. Configure Python Interpreter
Now to we will need to define the python interpreter in vs code to do that: Open command
palette by using the shortcut ctrl+shift+p or in the menu go to view> command palette.
In the command palette search for Python: Select Interpreter, it will show select python
interpreter option click on it and now you need to choose the python interpreter it will
display the installed python interpreter on your machine select it.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


3. Running Python In VS Code
To write and run python in vs code, click on the explorer tab in the left sidebar, Click on
Open Folder so create a folder in your desktop and select it, now it will display your folder
name in explorer.

To create a python file inside that folder, move your cursor beside your folder name, it will
display a button to create a new file click on it and name the test.py. Make sure the name
ends with .py as it defines a python file.

In the python file write print(“Hello World”) and click on the button in the top right side.
it will open a terminal with output Hello World.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in


You can also run a python program in vs code by opening a terminal, to open terminal use
shortcut ctrl+` or Go to menu: Terminal> New Terminal it will open a terminal in your
current folder, In the terminal type python test.py and hit enter.
It will print the same output Hello World which got earlier you can see from below image.

Note: I wrote test.py because my python file name is test.py so you need to write the name
of the python file you want to run.

Copyright 2023, PRAGYATMIKA, All Rights reserved . helpdesk@pragyatmika.co.in

You might also like