tut 14 a4 prerequisites
play

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


  1. Tut#14: A4 Prerequisites CPSC 501 Dr. J. Hudson University of Calgary Arshia Hosseini T01/T02

  2. Option 1: Virtual Environment • 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. 2

  3. Creating the venv • 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 3

  4. Installing the required packages • 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 4

  5. Pandas • Pandas is a column-oriented data analysis API. It's a great tool for handling and analyzing input data, and many ML frameworks support pandas data structures as inputs • pip install tornado • pip install nose • pip install pandas 5

  6. Option 2: An awesome alternative – Google Colab • 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. 6

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

Recommend


More recommend