Tut#14: A4 Prerequisites CPSC 501 Dr. J. Hudson University of - - PowerPoint PPT Presentation

tut 14 a4 prerequisites
SMART_READER_LITE
LIVE PREVIEW

Tut#14: A4 Prerequisites CPSC 501 Dr. J. Hudson University of - - PowerPoint PPT Presentation

Tut#14: A4 Prerequisites CPSC 501 Dr. J. Hudson University of Calgary Arshia Hosseini T01/T02 Option 1: Virtual Environment Python Virtual Environments allow Python packages to be installed in an isolated location for a particular


slide-1
SLIDE 1

Tut#14: A4 Prerequisites

CPSC 501

  • Dr. J. Hudson

University of Calgary

Arshia Hosseini

T01/T02

slide-2
SLIDE 2

Option 1: Virtual Environment

2

  • Python “Virtual Environments” allow Python packages to be

installed in an isolated location for a particular application, rather than being installed globally.

  • Imagine you have an application that needs version 1 of

LibFoo, but another application requires version 2. How can you use both these applications? If you install everything into /usr/lib/python3.6/site-packages (or whatever your platform’s standard location is), it’s easy to end up in a situation where you unintentionally upgrade an application that shouldn’t be upgraded.

slide-3
SLIDE 3

Creating the venv

3

  • CREATE VIRTUAL ENVIRONMENT
  • python3 -m venv env
  • ACTIVATE YOUR VIRTUAL ENVIRONMENT
  • source env/bin/activate
  • source env/bin/activate.csh
  • DEACTIVATE YOUR VIRTUAL ENVIRONMENT
  • deactivate env
slide-4
SLIDE 4

Installing the required packages

4

  • pip is a package manager for Python. That means it’s

a tool that allows you to install and manage additional libraries and dependencies that are not distributed as part of the standard library.

  • pip install --upgrade pip
  • pip install numpy
  • pip install matplotlib
  • pip install Pillow
  • pip install pyscreenshot
  • pip install tensorflow
slide-5
SLIDE 5

Pandas

5

  • Pandas is a column-oriented data analysis API. It's a

great tool for handling and analyzing input data, and many ML frameworks support pandasdata structures as inputs

  • pip install tornado
  • pip install nose
  • pip install pandas
slide-6
SLIDE 6

Option 2: An awesome alternative – Google Colab

6

  • Colab allows you to write and execute Python in your

browser, with

  • Zero configuration required
  • Free access to GPUs
  • Easy sharing
  • a Colab notebook that lets you write text and code as

well as executing the codes.

slide-7
SLIDE 7

7

  • https://colab.research.google.com