You can be a data scientist on any operating system. In general, most professionals choose a UNIX-type OS; typically Apple's OS X or a popular Linux distribution, such as Ubuntu. If you're already using Mac or Linux, great! Skip ahead to Part 2 and get started with your installs.
However, there is a growing need for (and interest in) data science in industries that traditionally use PCs. If you're on a Windows machine, that's ok too! You'll just need to install an additional piece of software to provide a development environment similar to OS X and Linux.
Click here to download the Git Bash shell. This will allow you to emulate most of the common commands and functions native to OS and Linux systems.
- Open a terminal by hitting the apple key + spacebar, and typing 'terminal' in the spotlight search. Open the Terminal application.
- Type
git --version
in the terminal and hit enter - The returned version of git should be a major version of 2.x.x or greater, for example:
[person@computer]$ git --version
git version 2.17.1
Windows has no native git or terminal support. To achieve equivalent functionality, a program named GitBash must be downloaded from here.
-
First, head over to python.org. Click on the latest release for Python 3 (do not use Python 2!!).
-
Select a location to save the file to. Here, I've saved the file to my desktop. If you'd like to verify that the file downloaded correctly, you can run an md5 checksum on the file by using
md5sum.exe
(this comes bundled with gitbash) and verify the returned string (here shown ending in `be3e`) matches the checksum displayed on the webpage. -
Run
which python
to verify the installation location (it should be in:/Users//AppData/Local/Programs/Python/Python37/python
). Verify your python version is 3.x.x withpython -V
. Verify your pip package manager is installed withpip -V
. Don't worry about the version of pip - we'll update it in the next step. -
When opened, insert the following code block. Press
i
to enter insert mode before pasting the text below. When finished, pressEsc
followed bywq
. PressEnter
to write the changes to file.export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/Devel source ~/AppData/Local/Programs/Python/Python37/Scripts/virtualenvwrapper.sh
-
When finished, type
source ~/.bash_profile
to deploy the above changes. You may see some output on your terminal screen for the environment variables and directories being created. This is normal and a one-time occurrence. -
Now comes the big installation! Be sure you have activated your environment. It will display
()
above your terminal. Notice how we have(utc)
above our terminal prompt here, denoting we are in the utc virtual environment.pip install jupyter pandas matplotlib seaborn requests openpyxl pytime pdfminer.six PyPDF4
-
Finally, test all the dependent libraries and python version using the following code.
import pandas as pd import matplotlib import seaborn import requests import openpyxl import pytime import pdfminer import PyPDF4 !python -V
The returned results should be <code>Python 3.x.x</code> with no errors (no text in red). </details>
- To check if your Git installation was successful, open a new terminal window and try to run Git from the command line:
$ git --version
The output should be something like this:
$ git --version
git version 2.5.0
- Make sure you've registered yourself for a github account first. Once you get your email and username set up, do the following locally on your machine:
$ git config --global user.name "Your Name"
$ git config --global user.email [email protected]
These identifiers will be added to your commits and show up when you push your changes to GitHub from the command line!
While you can connect your local repositories (the work on your laptop) to remote repositories (those stored on GitHub) without much additional effort, this will prompt you to input your username and password quite frequently. However, there's an alternative known as SSH, which will let you create a file on your computer that will authenticate you to GitHub without entering your username and password over and over again.
Note: Remember, these steps are optional. If you're having trouble, feel free to chat w your instructor!
You can use these guides to get started:
- Working with SSH Key Passphrases
- Generating a New SSH Key and Adding it to the SSH Agent
- Adding a New SSH Key to Your GitHub Account
SSH, or Secure SHell, is a common means of adding an additional layer of security to a connection. It establishes authenticity between a client and a server. This can be useful for secure file sharing and remote application access.
There are a couple of steps to the high-level SSH process:
- A client makes a request to the server.
- A server responds by asking for authentication.
- A client provides authentication.
- If authentication is correct, a connection is established.