Repository navigation
Week 01 (January 8)
On the Macs in the Computing Lab, we did the following.
The first few weeks of this course, we will be using Jupyter Notebooks. The easiest way to access this notebook technology is to install [Anaconda Python]{https://www.anaconda.com/download/?lang=en-us#macos}. This system is available for Mac, Windows and Linux. For this course, however, it is strongly encouraged that you use an operating system with a command line interface, such as OSX (on Macs) or Linux.
The Lab machines have Anaconda Python already installed. The directions below tell you how to get starting using this version of Python on the lab machines.
-
Opened the Terminal App and set a few preferences (We changed the font size, and, under the "SHELL" tab, we set the window to "always close on exit".
-
Set the Terminal App Icon so that is stays in the dock (the "tray" of icons at the bottom of the Mac
Then, we created a .bash_profile file. To do this, do the following at the terminal prompt :
% cd
% nano .bash_profile # Or use your favorite text editor (VIM, VI, Emacs, etc)
Add the following text to this file, and save it :
# In file .bash_profile
# Some useful bash shell configurations.
# This file is run every time you run a start a new Terminal window
echo "Hello! Running .bash_profile"
# Set up colors for the directory command
alias ls='ls -FG'
# Make nice prompt
PS1='\[\e[0;34;1m\] \w % \[\e[0;1m\]'
export PS1
# Make sure we use the correct version of Python
ANACONDA=/usr/local/Anaconda3
export ANACONDA
PATH=${ANACONDA}/bin:${PATH}
export PATH
Save this file and exit. At the Terminal prompt, issue the following command
% ls -a
You should see your newly created .bash_profile file listed in the directory listing.
We can "run" this file so the commands take effect using the source command :
% source .bash_profile
You should see your "Hello, World" greeting, your prompt change color, and your current path displayed in the prompt. Feel free to customize your prompt - there are dozens of websites showing you how to do this. Also, you should see that you are getting the correct version of Python :
% which python
/usr/local/Anaconda3/bin/python
If your version says /usr/bin/python, then you do not have the correct version.
A few other simple commands you should be familiar with are ls (list files in a directory), cp and mv (copy and move files), and cd (change a directory).
First, we will create a directory, and then navigate to that directory and create a notebook. Keep in mind that if you are creating these files on the Lab computers, you may lose your work if the machines are re-booted. To avoid this, you can either store your work in the "THAWSPACE" disk, or save your work to a USB key.
% cd # return to home directory
% mkdir demo_codes
% cd demo_codes
% jupyter notebook
This should open a browser window with a blank notebook. From here, you can create your own notebook, or open one that you have downloaded from the course website.
@DonnaCalhoun Introduction to Parallel Computing (ME471/571, BSU)