Module 2 - Getting
Started
Installation of Anaconda
1. Download the Anaconda installer. (anaconda navigator)
2. (Optional) Anaconda recommends verifying the integrity of the installer
after downloading it.
3. Go to your Downloads folder and double-click the installer to launch. To
prevent permission errors, do not launch the installer from the
Favorites folder.
NOTE: If you encounter issues during installation
a) temporarily disable your anti-virus software during install
b) then re-enable it after the installation concludes.
c) If you installed for all users, uninstall Anaconda and re-install it for your user
only.
Installation of Anaconda contd.
4. Click Next.
5. Read the licensing terms and click I Agree.
6. It is recommended that you install for Just Me, which will install
Anaconda Distribution to just the current user account.
7. Click Next.
8. Select a destination folder to install Anaconda and click Next. Install
Anaconda to a directory path that does not contain spaces.
Eg. C:\Users\MN\anaconda3 ✓
C:\Users\M N\anaconda3 ✖︎
Installation of Anaconda contd.
Installation of Anaconda contd.
9. Choose whether to add Anaconda to your PATH environment variable.
We don’t recommend adding Anaconda to your PATH environment variable,
since this can interfere with other software. Ensure the box is unchecked as
shown on the next slide.
10. Choose whether to register Anaconda as your default Python.
Accept the default and leave this box checked.
11. NOTE: Use Anaconda software by opening Anaconda Navigator or the
Anaconda Prompt from the Start Menu.
12. Click Install. If you want to watch the packages Anaconda is installing, click
Show Details.
13. Click Next.
14. Optional: To learn more about Anaconda’s cloud notebook service, go to
[Link]
Installation of Anaconda scontd.
Installation of Anaconda contd.
Installation of Anaconda contd.
Run cmd command in the windows startup.
Set default to a folder or directory of your choice such as ‘notebooks’.
At the command prompt run the command anaconda-navigator
You should a window like the one shown on the next slide.
This shows that anaconda is properly installed.
Installation of Anaconda contd.
Installation of Visual Studio (VS)
Code For Python
Installation
1. Download the Visual Studio Code installer for Windows.
[Link]
2. Choose the System Installer link.
3. Once it is downloaded, run the installer (VSCodeUserSetup-
{version}.exe). This will only take a minute.
4. By default, VS Code is installed under C:\Users\{Username}\AppData\
Local\Programs\Microsoft VS Code.
Alternatively, you can also download a Zip archive, extract it and run
Code from there.
Installation of Visual Studio (VS)
Code For Python
Tip: Setup will add Visual Studio Code to your %PATH%, so from the
console you can type 'code .' to open VS Code on that folder. You will
need to restart your console after the installation for the change to
the %PATH% environmental variable to take effect.
Additional components and tools
Visual Studio Code is a small download by design and only includes
the minimum number of components.
Basic functionality like the editor, file management, window
management, and preference settings are included.
Most VS Code users will need to install additional components
depending on their specific needs.
Installation of Visual Studio (VS)
Code For Python
Commonly used components
Git - VS Code has built-in support for source code control using Git but
requires Git to be installed separately.
VS Code extensions
You can extend the VS Code editor itself through extensions. The VS
Code community has built thousands of useful extensions available
on the VS Code Marketplace.
Installation of Visual Studio (VS)
Code For Python
Python extension for Visual Studio Code
A Visual Studio Code extension with rich support for the
Python language (for all actively supported Python versions),
providing access points for extensions to seamlessly integrate and
offer support for IntelliSense (Pylance), debugging (Python
Debugger), formatting, linting, code navigation, refactoring, variable
explorer, test explorer, and more!
The Python extension does offer some support when running on
[Link] (which includes [Link]). This includes partial
IntelliSense for open files in the editor.
Installation of Visual Studio (VS)
Code For Python
Installed extensions
The Python extension will automatically install the following
extensions by default to provide the best Python development
experience in VS Code:
• Pylance - to provide performant Python language support
• Python Debugger - to provide a seamless debug experience with
debugpy
These extensions are optional dependencies.
Installation of Visual Studio (VS)
Code For Python
Extensibility
The Python extension provides pluggable access points for extensions
that extend various feature areas to further improve your Python
development experience. These extensions are all optional and
depend on your project configuration and preferences.
• Python formatters
• Python linters
Installation of Visual Studio (VS)
Code For Python
Quick start
• Step 1. Install a supported version of Python on your system (note:
that the system install of Python on macOS is not supported). We
have already installed Anaconda which has a Python executable.
• Step 2. Install the Python extension for Visual Studio Code.
• Step 3. Open or create a Python file and start coding!
Set up your environment
• Select your Python interpreter by clicking on the status bar.
Installation of Visual Studio (VS)
Code For Python
Installation of Visual Studio (VS)
Code For Python
Configure the debugger through the Debug Activity Bar
Installation of Visual Studio (VS) Code For
Python Testing
Configure tests by running the Configure Tests command
Installation of Visual Studio Code For
Jupyter Notebook
Configuring VS Code for Jupyter Notebook will be done later in the
course.
First Program
In VS Code go to the Terminal menu option
Choose New Terminal
In the Terminal window, type python at the command prompt.
At Python prompt ‘>>>’
>>>print(‘Hello World!’)
Hello World
The print function displays supplied text on the screen.
Second Program
In the VS Code Editor enter the following:
name = input(‘Please enter your name: ’)
print(‘Hello, ‘, name)
Go to File->Save As….
Save file as my_name.py
Go to Run->Start Debugging.
Choose Python Debugger.
Second Program
The user interaction is as follows:
Please enter your name: Jack
Hello, Jack
The input() prompts for your name.
You enter your name followed by enter.
It is saved in a variable called name
print() displays the text on screen
Try this:
Make some changes to the print statement.
You can greet by saying ‘Good Morning’ instead of ‘Hello’
Save the file.
Run the program.
Key Takeaways
Know how to install Python on Windows 7
On Windows, how to create a development environment
Be able to enter expressions and commands in the shell window
Be able to write, save, run and modify short programs using VS Code
editor.