These instructions were tested under Linux Mint 20. The toolset instructions below will probably work more or less as described in an OSX environment. I won’t be able to provide help for Windows or OSX installation.
A couple of items to note:
There are a number of ways to handle installing Python packages, each
with advantages and disadvantages. One option is to use pip
to
install packages for a single user in your home directory. This is
probably preferable to installing packages system-wide because it less
likely to interfere with your overall system configuration. The steps
below will be executed in a terminal window. To start a terminal
window, click on the black screen icon, located in the bottom left
corner.
sudo apt-get update
sudo apt-get install python3-distutils python3-pip python3-dev python3-venv python3-testresources
python -m pip install --upgrade pip
echo 'export PATH="$HOME/.local/bin/:$PATH"' >> ~/.bashrc
source ~/.bashrc
pip install --user matplotlib notebook pandas scikit-learn tensorflow tensorflow-datasets spyder seaborn nbgrader jupyter-client==6.1.12 etc_jupyterlab_nbgrader_validate
jupyter nbextension install --user --py nbgrader --overwrite
jupyter nbextension enable --user --py nbgrader
jupyter serverextension enable --user --py nbgrader
Another option is to use Python virtual environments. The advantage of this approach is that it allows a single user to switch between multiple Python configurations. You can use the following steps to set up a virtual environment with the tools for this course:
sudo apt-get update
sudo apt-get install python3-distutils python3-pip python3-dev python3-venv python3-testresources
python -m venv ~/venv
source ~/venv/bin/activate
pip install --upgrade pip
pip install matplotlib notebook pandas scikit-learn tensorflow tensorflow-datasets spyder seaborn nbgrader jupyterlab jupyter-client==6.1.12 etc_jupyterlab_nbgrader_validate
jupyter nbextension install --user --py nbgrader --overwrite
jupyter nbextension enable --user --py nbgrader
jupyter serverextension enable --user --py nbgrader
This virtual environment can be activated and deactivated on a per-terminal basis:
activates the environment and
deactivates it.
There may be times when you want to run your jobs on the CS lab machines, either in-person or remotely. This wiki page provides instructions logging in remotely:
https://wiki.cs.jmu.edu/student/stu/basics
The full tool set for this course takes up around 1.5G of space on disk, so please don’t follow the steps above to configure your account on the CS lab machines. Instead you can use a pre-configured virtual environment as follows:
Of course, you can use any text editor to write Python code. Personally, I find it helpful to have access to a Python-aware editor that can help with code formatting and includes a graphical debugger.
The instructions above installed the open-source
Spyder scientific Python IDE. It’s
OK. After following the installation steps above, it can be run from a
terminal by typing spyder
.
PyCharm is a bit more polished, but a bit more complex than Spyder.
The “Community Edition” would be fine, but there are some advantages to the professional version: it has Jupyter notebook integration and some other nice features.
Register for a free version of PyCharm professional. Visit https://www.jetbrains.com/community/education/#students.
After being approved, create your JetBrains account. You will need this to register your copy of PyCharm.
Download the Professional version of PyCharm from https://www.jetbrains.com/pycharm/download. At the welcome screen, select activate new license with: JetBrains account