Skip to content

Instantly share code, notes, and snippets.

@cwilper
Last active January 1, 2024 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwilper/fc29947405166b8d4d6054dfc5a4ec5c to your computer and use it in GitHub Desktop.
Save cwilper/fc29947405166b8d4d6054dfc5a4ec5c to your computer and use it in GitHub Desktop.
Minimal Conda environment for locally running the Coursera ML Specialization labs
#
# Minimal Conda environment for locally running the Coursera Machine Learning Specialization
# labs from https://www.coursera.org/specializations/machine-learning-introduction
#
# To use, download and unpack the notebooks from the course, make sure you have conda
# installed (Miniconda is fine), then create the environment for the first time:
#
# > conda env create -f coursera-ml.environment.yml
#
# Some optional labs, like Decision Trees in Course 2, Week 4, require graphviz
# to be installed for certain visualizations. If you want to run these, you must install
# graphviz separately, or you'll get an error about "dot" not being in the PATH at runtime.
# For example, in Ubuntu, run:
#
# > sudo apt install graphviz
#
# After that, anytime you want to launch the labs, cd to the directory you've downloaded
# them to, run the following, and launch the url it displays.
#
# > conda activate coursera-ml
# > jupyter lab
#
---
name: coursera-ml
channels:
- defaults
- conda-forge
dependencies:
# These versions match exactly what Coursera's Jupyter environment was running
# for the Machine Learning Specialization labs as of 2023/12/28.
- gcc=13.2.0
- matplotlib=3.3.2
- networkx=2.6.3
- numpy=1.21.6
- pandas=1.0.3
- python=3.7.6
- scikit-learn=0.22.2.post1
- sympy==1.5.1
- tensorflow=2.8.0
# It's not critical to match the exact version of JupyterLab Coursera uses,
# and we prefer something stable and up-to-date. This is the latest 3.x version.
- jupyterlab=3.6.6
# This provides support for %matplotlib magic in notebooks. Coursera runs
# ipympl 0.5.6, but this is only compatible with Jupyterlab 2.x according to
# https://matplotlib.org/ipympl/installing.html#compatibility-table
# Since we want JupyterLab 3.x, here we diverge and use the latest version
# compatible with that and Matplotlib 3.3.2.
- ipympl=0.8.8
# Coursera uses 7.5.1, but that's not compatible with ipympl 0.8.8,
# which needs at least 7.6. So here we choose the latest 7.6.x available.
- ipywidgets=7.6.6
- pip
- pip:
# We install this via pip because this way it doesn't try to install
# graphviz via conda, which would fail because of an incompatible version
# of libffi it requires (the version of Python we're using requires an older
# version of that library). Doing it this way, we rely on "dot" being in
# the PATH at runtime, as described above.
- pydot==1.4.2
variables:
# Not required, but this keeps TensorFlow warnings/info messages to a minimum
TF_CPP_MIN_LOG_LEVEL: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment