Home

Installing Python and Git

how to install software and set up a workspace locally

MacOS

Step 1: Create a GitHub Pro Account

  1. Go to github.com
  2. Create an account with your @gettysburg.edu email address.
  3. Confirm email.
  4. Go to https://education.github.com/pack.
  5. Click "Get the pack" and fill out the form and follow their directions.
  6. Log into your GitHub Account and you should see a "PRO" badge on your profile.
  7. Update in any profile information you would like to.
  8. In the search dialogue, search for my username, "PeterEFrancis", and follow me, so I can see your account.

Step 2: Download Atom

  1. Go to atom.io
  2. Click download and note the saved file location.
  3. After installing, unzip the file, and drag the atom application to your Applications folder. (You might have to go to security and privacy in system preferences and allow Atom to be run).
  4. Open Atom
  5. "Atom" > "Preferences", and then " + Install"
  6. Search for and install the "language-python" and "teletype" packages (if they are not already instsalled).

Step 3: Install Homebrew

  1. Open a terminal window and enter the following line:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    Press the enter key to run.
  2. Confirm any prompts in the terminal as Homebrew is downloading. Depending on your Xcode installation, this may also install "Command Line Tools".
  3. After Homebrew has installed, if you are using OS X 10.12 (Sierra) or older, run this line in the terminal
    export PATH=/usr/local/bin:/usr/local/sbin:$PATH
    otherwise run this line
    export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Step 4: Install Python (and pip)

  1. Run this line in the terminal:
    brew install python
  2. Run this line in the terminal
    which python3
    and you should see "/usr/local/bin/python3".

Step 5: Install Jupter notebook

  1. Run this line in the terminal:
    python3 -m pip install jupyter
  2. Run this line in the terminal
    which jupyter
    and you should see "/usr/local/bin/jupyter".

Step 6: Install Git (if you don't have it)

Run this line in the terminal:

git --version

If you don’t have git installed already, this will prompt you to install it. If you do have it, you will see something like "git version 2.24.2 (Apple Git-127)".

Step 7: Create a Git Repository for this course

  1. Log into your Github account
  2. Click the green "New" repository button.
  3. Enter "learning-python" as the repository name.
  4. Click the check box that says Initialize this repository with a README.
  5. Click "Create Repository".
  6. Click "Code" and then under "Clone", copy the URL that is in the dialogue that opens.
  7. Open a terminal window and run the following lines.
    cd ~
    mkdir Programming
    cd Programming
    git clone <paste the link you copied here>
  8. Open Atom
  9. "File" > "Add Project Folder...", and open the folder that you just created ("learning-python") which is in the new master directory "Programming". (I suggest you drag "Programming" to the side of a finder window to be in the sidebar with Documents, Desktop, etc.).
  10. On the left hand side of the window, you should see a file structure tree with "learning-python" the parent directory, and inside it, one file named "README.md". If you don't see the file structure, move your mouse to the left edge of the widonw and click the arrow that pops up.
  11. Click "README.md" to open it. Underneath "# learning-python", type anything you want.
  12. Right click "learning-python" and create a new File named ".gitignore" (dont miss the dot!).
  13. In ".gitignore", type "**/.ipynb_checkpoints" and save the file.
  14. In the bottom right hand corner, click "Git". (Sign into your GitHub account if it prompts you to do so and if there is an option to save your credentials, check it).
  15. Click "Stage all" on the top right, enter a commit message like "initial test", and then click "Commit".
  16. Click "Push" on the bottom of the window.
  17. Open your GitHub account again and refresh the page. You should see that "README.md" now has the line that you added in Atom. You should also be able to see the ".gitignore" file.

Windows

Step 1: Create a GitHub Pro Account

  1. Go to github.com
  2. Create an account with your @gettysburg.edu email address.
  3. Confirm email.
  4. Go to https://education.github.com/pack.
  5. Click "Get the pack" and fill out the form and follow their directions.
  6. Log into your GitHub Account and you should see a "PRO" badge on your profile.
  7. Update in any profile information you would like to.
  8. In the search dialogue, search for my username, "PeterEFrancis", and follow me, so I can see your account.

Step 2: Install PyCharm

  1. Go to https://www.jetbrains.com/pycharm/download/#section=windows
  2. Download the "Community" version, which is free.
  3. Follow all of the intstallation prompts with all of the default options except for the "Installation Options" page, on which you should click every check box available.
  4. Once the installation is complete, if you will be prompted to restart your computer, do so.

Step 3: Create a Git Repository for this course

  1. Create a new folder in your user directory called "Programming".
  2. Log into your Github account
  3. Click the green "New" repository button.
  4. Enter "learning-python" as the repository name.
  5. Click the check box that says Initialize this repository with a README.
  6. Click "Create Repository".
  7. Click "Code" and then under "Clone", copy the URL that is in the dialogue that opens.
  8. Open PyCharm and click "Skip Remaining and Set Defaults" on the bottom left of the window.
  9. Click "Get from Version Control".
  10. Paste the URL that you copied into the input box for the URL.
  11. Make sure the drop down menue has "Git" selected. Click "Download Git" if there is a note that says that git is not installed. Wait for it to finish downloading.
  12. Click "Clone".
  13. Enter GitHub login credentials and check "Rememeber".
  14. Close the "Tip of the Day" popup.
  15. On the left hand side of the window, you should see a file structure tree with "learning-python" the parent directory, and inside it, one file named "README.md".
  16. Click "README.md" to open it.
  17. Click the button with four horizontal lines on the top right of the file in order to change the view of the markdown from rendered, to un-rendered.
  18. Underneath "# learning-python", type anything you want.
  19. Right click "learning-python" and create a new File named ".gitignore" (dont miss the dot!).
  20. When the dialogue comes up to "Add File to Git", click "Add".
  21. In ".gitignore", type "**/.ipynb_checkpoints" and save the file.
  22. "VCS" > "Commit" (or "Ctrl + K").
  23. Enter a commit message like "initial test", and then click the blue "Commit" button.
  24. If prompted, enter name and GitHub-associated email, and check "Set properties globally". Then click "Set and Commit".
  25. "VCS" > "Git" > "Push" (or "Ctrl + Shift + K"), then push the blue "Push button".
  26. If prompted, enter GitHub username and password, and check "Rememeber". Then click "Log In".
  27. Open your GitHub account again and refresh the page. You should see that "README.md" now has the line that you added in PyCharm. You should also be able to see the ".gitignore" file.

Step 4: Setting the Virtual Environment Python Interpreter

  1. Open Pycharm and make sure you are in the "learning-python" repository.
  2. "File" > "Settings", and then "Project: learning-python".
  3. Click "Project interpreter".
  4. Click the "+" on the right side of the window.
  5. In the drop down menu, select "Show all" and press the plus sign.
  6. Select "Virtual Environment" in the left-hand column, and then "New Environement". Make sure that the "Location" ends with "\venv". Click "Ok". This will set the Python interpreter.
  7. If you do not see a Windows pupup asking for permission to make changes, check the taskbar to open the popup. Click "Yes" and the download will commence.
  8. You will now see "Python 3.8 (learning-python)" as an option for an intertreter. Select it and Click "OK".
  9. Click "OK" again to close the "Settings" dialogue.

Step 5: Install Jupyter

  1. "File" > "Settings", and then "Project: learning-python".
  2. Click "Project interpreter".
  3. Search for "jupyter" and once jupyter is selected, click the "Install Package" button.
  4. Wait for the download to complete (you can see a wheel spinning ject to "jupyter") -- it might take a while.
  5. Close that dialogue and click "OK" to close the "Settings" dialogue.