Skip to content

00. MacOS Setup

$\gdef \N{\mathbb{N}} \gdef \Z{\mathbb{Z}} \gdef \Q{\mathbb{Q}} \gdef \R{\mathbb{R}} \gdef \C{\mathbb{C}} \gdef \setcomp#1{\overline{#1}} \gdef \sseq{\subseteq} \gdef \pset#1{\mathcal{P}(#1)} \gdef \covariant{\operatorname{Cov}} \gdef \of{\circ} \gdef \p{^{\prime}} \gdef \pp{^{\prime\prime}} \gdef \ppp{^{\prime\prime\prime}} \gdef \pn#1{^{\prime\times{#1}}} $

Since the provided instructions only detail how to prepare the workspace for Windows, I did some research and tinkering to find out what needs to get set up for MacOS. I chose not to use PyCharm, opting for VSCode instead, but it shouldn’t really make a difference, it’s just a text editor.

Install Python 3.8

PyEnv – Python Version Manager

The instructions specify to install Python 3.8.0. I, for no particular reason, went with the latest 3.8 release (3.8.19). It shouldn’t make a difference.

Using brew, install pyenv with the Terminal:

Bash
brew install pyenv

Once that runs, go to the instructions at this section of the PyEnv GitHub repository, and find the steps specific to your shell environment. You can find your shell by running echo $SHELL.
I’m using zsh, so I ran the following commands:

Bash
1
2
3
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc

Once your shell environment is configured properly, run exec "$SHELL" to apply the changes you made.

Next, choose where you want your working directory. I’ll be using ~/Documents/Machon Lev/Year II/Semester II/AdComms as my working directory.

Navigate to the folder you chose with the terminal.

Bash
cd ~/Documents/Machon Lev/Year II/Semester II/AdComms

Python Installation

If you want to use the latest patch release of Python 3.8, remove the trailing .0 from the python version where appropriate.

To install the first release of Python 3.8, run the command as is:

Bash
pyenv install 3.8.0

Once you’re in your working directory, run:

Bash
pyenv local 3.8.0

PyEnv Local Installation

The local specifier means that your selected version of python will automatically be selected when you are within the designated folder (in the terminal), and it’ll switch back to the default version when you navigate back out of that folder.

The following commands all assume that they’re run from within your workspace folder, with Python 3.8 active.

Configure Packages

Create a Virtual Environment for your workspace.

Bash
python -m venv .venv

Activate the Virtual Environment:

Bash
. .venv/bin/activate

Install scapy.
pip install scapy

Configure Workspace

In your workspace, create two folders:

  • webroot
  • work

End Results

Here’s what my VSCode window looks like after the setup, with version checks in the terminal.
Pasted image 20240502174952.png