Series: Artificial Intelligence

Install the Fastai Course Requirements on Mac

An expanded guide with definitions of terms and commands

David Littlefield
Mac O’Clock

--

This article is an expanded guide that’s meant to help you learn what’s happening throughout the chapter. It provides definitions of terms, commands, and code that are used in the article. It also includes underlined text which has links to additional definitions in the glossary of the article.

Open Terminal:

The Terminal is a program that’s included with macOS that provides users with access to the operating system using a command-line interface. It uses Z shell by default which replaced Bourne Again Shell as the system shell. It can also work with other shell like Korn, Tenex C, and Bourne Again Shell.

  1. Press “Command ⌘ + Spacebar”
  2. Enter “Terminal” into the search bar
  3. Press “Return”

Open the Desktop Directory:

The Change Directory (cd) command is used to change the current working directory to the specified directory. It can navigate to absolute and relative paths that start from the root and current working directory, respectively. It can also navigate to paths stored in variables and environment variables.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
cd $HOME\desktop\

Install Xcode Select:

Xcode Select is a program that’s used on Mac to switch between the different sets of command line tools that are provided by Apple. It acts as the master switch for the actual paths that are resolved when invoking commands for command line programs. It contains various developer tools but it doesn’t include the software development kit that’s needed to build Xcode projects.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
  4. Click “Install”
  5. Click “Agree”
$ xcode-select --install

Clone the Fastbook Repository:

The Clone command is used in Git to download the specified repository from GitHub. It copies all the files, subdirectories, branches, and commits for the entire history of the repository. It can also be combined with the recursive flag to copy the submodules the repository uses as dependencies.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
git clone --recursive https://github.com/fastai/fastbook.git

Open the FastBook Directory:

The Change Directory (cd) command is used to change the current working directory to the specified directory. It can navigate to absolute and relative paths that start from the root and current working directory, respectively. It can also navigate to paths stored in variables and environment variables.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
cd fastbook

Upgrade Pip:

The Upgrade (U) option is used in pip to update the specified package that’s already installed on the computer. It can be used to download and install the latest version of the package from the Python Package Index. It can also be used to download and install the latest version of pip package manager.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
python -m pip install --upgrade pip

Install Virtualenv:

Virtualenv is a program that’s used in Python to create and manage virtual environments. It can specify which Python version and directory is used to create the virtual environment. It also installs all the necessary files into the specified directory instead of the systemwide Python installation directory.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
python -m pip install virtualenv

Create the Virtual Environment:

Virtualenv is a command that’s used in Virtualenv to create isolated Python environments. It specifies the name of the directory that’s used to install the virtual environment. It can also specify the version of Python that’s used to create the virtual environment but it uses the default version by default.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
Python 3.6:
python -m virtualenv --python python36 venv36
Python 3.7:
python -m virtualenv --python python37 venv37
Python 3.8:
python -m virtualenv --python python38 venv38
Python 3.9:
python -m virtualenv --python python39 venv39

Activate the Virtual Environment:

The Activate script is used to start the virtual environment. It prepends the virtual environment path to the PATH environment variable which sets the new Python interpreter and package manager as the default version. It also sets packages to install in the virtual environment installation directory.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
Python 3.6:
source venv36/bin/activate
Python 3.7:
source venv37/bin/activate
Python 3.8:
source venv38/bin/activate
Python 3.9:
source venv39/bin/activate

Upgrade Fastbook:

The Upgrade (U) option is used in pip to update the specified package that’s already installed on the computer. It can be used to download and install the latest version of the package from the Python Package Index. It can also be used to download and install the latest version of pip package manager.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
python -m pip install --upgrade fastbook

Install the Dependencies:

The Dependency is an additional binary package that a particular binary package needs to work properly. It can require multiple dependencies to build almost any program that’s distributed by package managers. It also gets downloaded and installed automatically by some package managers.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
python -m pip install graphviz kaggle waterfallcharts treeinterpreter dtreeviz gdown

Install Graphviz:

Graphviz is a library that’s used on multiple operating systems for graph visualization. It can create diagrams from textual descriptions of graphs using a simple text language. It can also customize diagrams with various colors, fonts, tabular node layouts, line styles, hyperlinks, and shapes.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
brew install graphviz

Install the Virtual Environment:

The Install command is used in IPython kernel to add the specified virtual environment to the kernels in Jupyter Notebook. It specifies the directory name that’s used to reference the virtual environment. It also specifies the display name that’s used to refer to the virtual environment in file menus.

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Return”
Python 3.6:
venv36/bin/python -m ipykernel install --name "fastai-pytorch" --display-name "FastAI (PyTorch)"
Python 3.7:
venv37/bin/python -m ipykernel install --name "fastai-pytorch" --display-name "FastAI (PyTorch)"
Python 3.8:
venv38/bin/python -m ipykernel install --name "fastai-pytorch" --display-name "FastAI (PyTorch)"
Python 3.9:
venv39/bin/python -m ipykernel install --name "fastai-pytorch" --display-name "FastAI (PyTorch)"
Extra Resources: Want to learn how to use artificial intelligence, machine learning, and deep learning? This blog is covering the Fastai course and interesting repositories related to the field.
Fastai:
1. Chapter 1: Your Deep Learning Journey Q&A
2. Chapter 2: From Model to Production Q&A
3. Chapter 3: Data Ethics Q&A
4. Chapter 4: Under the Hood: Training a Digit Classifier Q&A
5. Chapter 5: Image Classification Q&A
6. Chapter 6: Other Computer Vision Problems Q&A
7. Chapter 7: Training a State-of-the-Art Model Q&A
Linux:
01. Install and Manage Multiple Python Versions
02. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
03. Install the Jupyter Notebook Server
04. Install Virtual Environments in Jupyter Notebook
05. Install the Python Environment for AI and Machine Learning
06. Install the Fastai Course Requirements
WSL2:
01. Install Windows Subsystem for Linux 2
02. Install and Manage Multiple Python Versions
03. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
04. Install the Jupyter Notebook Server
05. Install Virtual Environments in Jupyter Notebook
06. Install the Python Environment for AI and Machine Learning
07. Install Ubuntu Desktop With a Graphical User Interface (Bonus)
08. Install the Fastai Course Requirements
Windows 10:
01. Install and Manage Multiple Python Versions
02. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
03. Install the Jupyter Notebook Server
04. Install Virtual Environments in Jupyter Notebook
05. Install the Python Environment for AI and Machine Learning
06. Install the Fastai Course Requirements
MacOS:
01. Install and Manage Multiple Python Versions
02. Install the Jupyter Notebook Server
03. Install Virtual Environments in Jupyter Notebook
04. Install the Python Environment for AI and Machine Learning
05. Install the Fastai Course Requirements

Glossary:

The Shell is an interpreter that presents the command-line interface to users and allows them to interact with the kernel. It lets them control the system using commands entered from a keyboard. It also translates the commands from the programming language into the machine language for the kernel.
[Return]

The Interpreter is a program that reads through instructions that are written in human-readable programming languages and executes the instructions from top to bottom. It translates each instruction to a machine language the hardware can understand, executes it, and proceeds to the next instruction.
[Return]

The Command-Line Interface (CLI) is a program that accepts text input from the user to run commands on the operating system. It lets them configure the system, install software, and access features that aren’t available in the graphical user interface. It also gets referred to as the terminal or console.
[Return]

The Kernel is the program at the heart of the operating system that controls everything in the computer. It facilitates the memory management, process management, disk management, and task management. It also facilitates communication between the programs and hardware in machine language.
[Return]

The wslvar command is used in WSL2 to access the Windows environment variables from WSL2 . It specifies the environment variable but it doesn’t require the variable name to be enclosed in percentage signs. It can also be combined with command substitution to store the output in a variable.
[Return]

The Variable is the container that’s used to store different types of values. It can assign or update a value by placing an equals sign between the specified variable name and value without a space around it. It can also reference the stored value by placing a dollar sign in front of the existing variable name.
[Return]

The Environment Variable is a variable that’s automatically created and maintained by the computer. It helps the system know where to install files, find programs, and check for user and system settings. It can also be used by graphical and command-line programs from anywhere on the computer.
[Return]

Pyenv is a program that’s used for Python version management on macOS and Linux. It can install multiple Python versions, specify the version that’s used system-wide, and specify the version that’s used in specific directories. It can also create and manage virtual environments using specific versions.
[Return]

Git is a program that’s used to track changes that are made to the source code over time. It can handle projects of all sizes and allows multiple teams and people to make changes to the same repository. It can also restore the source code to a previous version from the entire history of the repository.
[Return]

The Repository is a storage location for binary packages that are located on remote servers. It needs to be present in the source list for the computer to install or update its containing packages. This helps provide a high level of security while making it easy to install programs in Linux distributions.
[Return]

The Binary Package is an archive file that contains the files and directories needed to make its containing program work properly. It gets stored in the repository that contains all the programs for a specific Linux distribution. It also requires the Linux package manager to access, extract, and install it.
[Return]

The Submodule is a repository that’s nested inside of a different repository as its subdirectory. It contains a copy of all the files for a specific version of the repository at a particular point in time. It also contains a copy of all the submodules within the repository that are considered its dependencies.
[Return]

Pip Installs Packages (pip) is the default package manager that’s used in Python. It allows users to easily install third-party packages that aren’t included in the standard Python library. It can install different package types but it mostly uses source distributions and built distributions.
[Return]

The Virtual Environment is an isolated Python installation directory that has its own interpreter, site-packages, and scripts. It mostly gets used to prevent version conflicts between dependencies from different projects. It also gets used to meet dependency requirements of different programs from GitHub.
[Return]

The PATH is an environment variable that contains the list of directories the computer uses to find executable files. It looks for the requested executable file in each directory on the list from top to bottom. It also stops searching once it finds a matching executable file and runs the program or command.
[Return]

Natural Language Processing (NLP) is a branch of artificial intelligence that’s concerned with giving computers the ability to understand text and spoken words. It combines computational linguistics with statistical, machine learning, and deep learning models. It also enables computers to process human language in the form of text or voice data and to understand its full meaning, complete with the intent and sentiment of the speaker or writer.
[Return]

Interactive Python (IPython) is the interactive shell and default kernel that’s used in Jupyter Notebook. It runs the Python code that’s contained in the Jupyter Notebook files. It also adds new functionality such as introspection, parallel computing, rich media, shell syntax, tab completion, and history.
[Return]

Jupyter Notebook is a program that’s used to create, modify, and distribute notebooks that contain code, equations, visualizations, and narrative text. It provides an interactive coding environment that runs in the web browser. It also has become a preferred tool for machine learning and data science.
[Return]

--

--

David Littlefield
Mac O’Clock

From: Non-Technical | To: Technical Founder | Writes: To Make It Easier For Everyone | Topics: #Startups #How-To #Coding #AI #Machine Learning #Deep Learning