Bash shell
You already have it! Depending on which version of Mac OS you’re running you may
need to type bash
inside the terminal to access it. To check whether this is
necessary, follow these steps:
- Open a terminal and type
echo $SHELL
. If it reads/bin/bash
then you are all set!
Note: If you are using Mac Catalina (10.15.X) then it is possible your default
shell is NOT CORRECT. To set the default to bash, type chsh -s /bin/bash
in
the terminal, enter your password when prompted, and then close + re-open the
terminal.
Git
You may already have it!
Try opening a terminal and typing git --version
.
If you do not see something like “git version X.XX.X” printed out, then follow these steps:
- Follow this link to automatically download an installer.
- Double click the downloaded file (
git-2.23.0-intel-universal-mavericks.dmg
) and then double click thegit-2.23.0-intel-universal-mavericks.pkg
icon inside the dmg that is opened. - Follow the on-screen instructions to install the package.
Git configuration
In case you have never used Git on your computer, you may have to configure it.
Type the following commands, and make sure to use the name and email associated with your GitHub account.
git config --global user.name "Jane Doe" git config --global user.email "janedoe@example.com" git config --global core.autocrlf true
Tip: You can review your configuration at any time with: git config --list
Create a personal access token (PAT) for GitHub
To authenticate to GitHub from the command line, you will use a PAT instead of your GitHub account password. In this course, when using a git command that prompts you for your password, you will enter this token.
Log in to your GitHub account, and follow these instructions to create a fine-grained PAT.
Use an informative name for the token, such as QLSC612_PAT.
- Under
Expiration
, select 7 days - Under
Resource owner
, select your username - Under
Repository access
, select All repositories - Under
Permissions
, navigate to Contents and change the access level to Read and write
Then, click Generate token
, and copy and store the resulting token value in a secure location.
To use git/GitHub for your own purposes after this course, you can use the GitHub CLI or Git Credential manager instead of creating a PAT.
For more info, see:
VSCode
- Go to this page and click the download button.
- Unzip the downloaded file (for example,
VSCode-darwin-stable.zip
) and moving the resultingVisual Studio Code
file to your Applications directory.
VSCode extensions
- Open the Visual Studio Code application
- Type
Cmd+Shift+P
to open the “command palette” at the top of the screen and then enterShell command: Install 'code' command in PATH
. Select the highlighted entry. A notification box should appear in the bottom-right corner indicating that the command was installed successfully. - Open the Extension side panel by pressing
Cmd+Shift+X
. In the search bar at the top of this panel search for each of the following extensions and pressInstall
for the first entry that appears.
- Python Extension Pack (note that you will need to reload VSCode after installing this)
- Live Share (Note you may need to press "Ctrl/Cmd+Shift+P" and type "install extensions" again after installing this)
- Docker
- WSL
Python
-
Open a new terminal and type the following lines (separately) into the terminal, pressing
Enter
after each one:curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh bash Miniconda3-latest-MacOSX-x86_64.sh
- A license agreement will be displayed and the bottom of the terminal will read
--More--
. PressEnter
or the space bar until you are prompted with “Do you accept the license terms? [yes|no].” Typeyes
and then pressEnter
- The installation script will inform you that it is going to install into a
default directory (e.g.,
/home/$USER/miniconda3
). Leave this default and pressEnter
. - When you are asked “Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no],”
type
yes
and pressEnter
. Exit the terminal once the installation has finished. - Re-open a terminal.
Type
which python
into the terminal and it should return a path (e.g.,/home/$USER/miniconda3/bin/python
).- If you do not see a path like this then please try typing
conda init
, closing your terminal, and repeating this step. If your issue is still not resolved skip the following step and contact an instructor on the#help-installation
channel of the Slack workspace.
- If you do not see a path like this then please try typing
-
Type the following to remove the installation script that was downloaded:
rm ./Miniconda3-latest-MacOSX-x86_64.sh
Python packages
Open a terminal and type the following commands (press Enter
after each):
conda config --append channels conda-forge conda config --set channel_priority strict conda create -n qlsc612 -y python=3.12 flake8 jupyterlab nilearn matplotlib seaborn bokeh statsmodels plotly wordcloud conda activate qlsc612
This installation step (conda create
) will take a couple minutes.
The above commands create a new conda Python environment named qlsc612
with all the necessary packages installed for this course.
The last line, conda activate qlsc612
,
will activate this Python environment (the default environment is base
).
Docker
-
Go to this page and press the button
Docker Deskptop for...
corresponding to the chip of your machine (see the image below). -
Open the
Docker.dmg
file that is downloaded and drag and drop the icon to the Applications folder. -
Open the Docker application and enter your password. An icon will appear in the status bar in the top-left of the screen. Wait until it reads
Docker Desktop is now up and running!
-
Open a new terminal and type
docker run hello-world
. A brief introductory message should be printed to the screen.
The above step-by-step Docker instructions are distilled from here. If you have questions during the installation procedure please check that link for potential answers!