Before beginning these instructions you should have first updated your operating system and then installed the required software (Python 3.9, Visual Studio Code, and git).
0. Find Your Official UNC E-mail Address
Primary e-mail addresses do not end in @ad.unc.edu. They typically end in @live.unc.edu or @email.unc.edu!
Find your primary e-mail address by logging into Sakai, clicking on your name in the top right corner, selecting Profile, and looking under the Email field: https://sakai.unc.edu/
Use your primary e-mail address when you register for GitHub.
1. Register for GitHub
GitHub is for backing up your course Workspace Repository and for downloading course materials.
You can think of GitHub as a social network where people and organizations share and collaborate on code with one another. Organizations like NASA, NOAA, Peace Corps, Washington Post, New York Times, and so on, host projects publicly (and privately) on GitHub. It’s a valuable service for data scientists, software engineers, research teams, and more.
Your coursework will have its own private “git repository”. The technology we use for backing up versions of our projects and transmitting them to or from the internet, hosted on GitHub, is called git. Visual Studio Code has git support built into it. Git is a professional version control tool we use in limited ways in COMP110, but if you continue on in a field that involves programming and data you’ll likely encounter it again.
- Register for a GitHub account with your primary UNC address: https://github.com/
- After registering, edit your profile from this page: https://github.com/settings/profile
- Be sure your name and email match what you used on Course.Care
- Fill out the rest of your GitHub profile with a high quality photo of yourself, a brief bio, UNC Chapel Hill as your “company”, and Chapel Hill (or home) as your location if you are going to continue in a field that involves programming (computer science, data science, information science, and so on). Think of this as a secondary LinkedIn when it comes to future opportunities, because that’s often how employers and graduate schools look at it.
2. Setup your Workspace in Visual Studio Code
- Open Visual Studio Code
- Open the View menu and select Command Palette
- You’ll use the Command Palette a lot so it’s worth trying to remember its shortcut!
- Windows:
Control+Shift+P
- Mac:
Command+Shift+P
- Type in “Git: Clone” (without the quotes) and press
Enter
.- If you do not see this option after installing course software previously, try rebooting your computer.
- Copy the following URL:
https://github.com/comp110-21s/comp110-21s-workspace.git
- Right Click and Paste the copied URL into the text box that appeared in VS Code after the previous step.
- Or use the Paste keyboard shortcut:
Control+V
Windows /Command+V
Mac
- Press Enter and you will be asked where you want your course workspace repository to be saved on your computer. Just accepting the default suggestion is OK.
- Visual Studio Code may ask you to enter your GitHub username and password in the same place you just entered your Workspace Repository URL. If you don’t see this prompt you can proceed to step 7.
- If it asks for your GitHub username, type it in and press enter. Your username can be found in the top left of your GitHub profile at https://github.com/settings/profile.
- If it asks for your GitHub password, type it in and press enter. Your password will show up as dots as you type.
- Press OK when asked if you would like to Open the repository after it downloads.
3. Installing VSCode Extensions
VSCode can be customized with extensions specific to the types of work you use it for. We will install extensions that help us this this course. We recommend limiting the number of additional extensions you install, you shouldn’t need any more for our course, because they can slow down VSCode and not cooperate with one another nicely in some configurations.
- If you see a popup notifying you “This workspace has extension recommendations.” then click “Install All”
- VSCode will ask you to restart for the Pylance extension. Allow it to.
- Press ignore for any additional prompts to install additional plugins such as
pytest
orflake8
. For these you can click the gear icon and ask VSCode to stop recommending them.
- Confirm you have the correct VS Code extensions installed by clicking the
View
menu and selectingExtensions
. If you do not see the following listed under “Installed”, find them under Recommended, click on each, and click install.- Python
- Pylance
- Jupyter
- Edit csv
- One Monokai Theme
- We will use the “One Monokai Theme” for code/font coloring. You are encouraged to use this as well, so that your work looks the same as ours. To enable this theme, click on the One Monokai Theme extension after installing it, click “Set Color Theme”, and at the top of your VSCode window where you see a drop-down occur, select “One Monokai Theme” and you should see a subtle change of colors.
- Restart VSCode by going to File > Exit and then opening VSCode.
4. Installing Python Libraries
We will use some popular 3rd party libraries this semester in COMP110. These are freely available, open source packages that other software developers made and shared. The packages installed will help us with some data science concerns when we reach that segment of the course.
- Open the File menu, followed by Open Recent and you should see the top entry listed as something like “comp110-21s-workspace”
- If you do not, try closing and reopening VSCode.
- In the future, if you open VS Code and need to get back to your COMP110 Workspace, the easiest way is to repeat step 1 above.
- In the bottom “status bar” of VSCode, to the right of “master” and a refresh icon, you should now see Python followed by a version number. If the version number is not there or is not 3.9 or greater, follow the next bullet:
- Open the View menu and Command Palette. Type “Python: Select Interpreter” (without the quotes) and press Enter. From the list that pops up choose Python 3.9 or greater.
- Open the View menu and select Terminal to bring up the built-in terminal.
- In the Terminal type the following command, being careful to match it exactly.
- Press
Enter
to run the command. This command installs additional Python libraries, which give you functionalities we’ll use later in the course.
5. Setup your Backup Workspace on GitHub
- Navigate a web browser to https://classroom.github.com/a/vjk6Jd9d
- Join the Classroom by selecting your ONYEN (Clicking “Skip to the next step” is also OK)
- Click “Accept this Assignment”
- When the workspace is getting setup you may need to refresh until it tells you you’re ready to go!
- Click the link to your personal backup repository that looks something like this
https://github.com/comp110-21s/comp110-workspace-21s-KrisJordan
(except instead ofKrisJordan
you will see your GitHub username). - Toward the top of the page it will say “Quick setup” and you will see two buttons: HTTPS and SSH. Click HTTPS.
- Copy the text in the box to the right of the HTTPS/SSH buttons (or click the clipboard icon). This is the URL to your backup repository.
- In VSCode, ppen the View menu and select Command Palette, the shortcut for this menu is:
- Windows:
Control+Shift+P
- Mac:
Command+Shift+P
- Windows:
- In VSCode, type in Git: Add Remote and press enter with the option selected.
- In the blank text box that appears, paste in the URL to your backup repository that you just copied. Press enter.
- When asked for “Remote name” type in:
backup
- Open up the Command Palette once more, just as in step 8.
- Begin typing in:
Git: Push to...
and pressEnter
once it is the first option. - Select the
backup
remote that is your personal workspace on GitHub.
- You may see a spinning “refresh” icon in your status bar at the bottom of VSCode. Unless an error backing up occurs, you will not see any confirmation. It succeeds silently.
- If you want to see your backed up work on Github, back in your web browser, refresh the page you had open and you should see files in it now.
6. Configure your git
Name and E-mail
- If your Terminal window from above is still open from section 3, great! If not, open a new Terminal pane in VS Code.
- At the prompt, type the following command and press enter with your primary e-mail address inside the double quotes:
- Then, type tye following command and press enter with your first and last name inside the double quotes:
After doing this, when you make backup commits in git
(which you’ll do shortly!) they’ll be correctly attributed to you.
7. Operating System Specific Configuration
Windows
If your laptop is running Windows, you should change the default shell in VSCode to be Git Bash.
- Open the View menu and select Command Palette (or press Control + Shift + P)
- Type: Select Default Shell
- Press Enter
- From the dropdown list, you should see Git Bash. Select it.
macOS
If your laptop is running macOS, you should confirm the default shell in VSCode is zsh
. This should already be the case, but to be sure, run these steps:
- Open the View menu and select Command Palette (or press Command + Shift + P)
- Type: Select Default Shell
- Press Enter
- From the dropdown list, you should see
zsh
in one of the options. Select it.
It is handy to be able to open Visual Studio Code from your Terminal using the code
command in the future. To register this:
- Open the View menu and select Command Palette (or press Command + Shift + P)
- Type: Install code command
- Press Enter
8. Confirm Everything is Good to Go
From the View Menu, select Explorer. You should see a left-hand sidebar with comp110-WORKSPACE at the top and if you expand it you should see exercises
, lessons
, projects
, sandbox
, and README.md
. These are folders, which we refer to more technically as directories, and files in your workspace.
Let’s be sure you are able to exit out of VSCode and find your work again. Go ahead and close VSCode. Then open new window. If you see the same files in the left-hand sidebar: great! Keep reading, though, so you know what to do in the future if you do not see your workspace.
If you do not see your workspace files in the Explorer sidebar, go to File, select Open Recent, and look for the topmost entry that is comp110-21s-workspace
and select it. This is how you can get back to your workspace most easily in the future.
Great work! Your software setup is now ready for COMP110!