diff --git a/checkenv.py b/checkenv.py index b850c4f1..266c1d6a 100644 --- a/checkenv.py +++ b/checkenv.py @@ -1,7 +1,7 @@ # Check that the packages are installed. -import os import sys from pkgutil import iter_modules +import subprocess def check_import(packagename): @@ -30,7 +30,7 @@ def check_import(packagename): assert ( sys.version_info.major >= 3 and sys.version_info.minor >= 6 -), "Please install Python 3.6!" +), "Please install Python >=3.6!" def print_error(p, i): @@ -53,9 +53,12 @@ def print_error(p, i): assert check_import(p), print_error(i, p) -# os.system returns 0 if command passed -assert not os.system("command -v ffmpeg"), "please install ffmpeg" - +# Credit: @bill-tucker-zywave for suggesting this fix. +# https://github.com/ericmjl/Network-Analysis-Made-Simple/issues/286#issuecomment-1108793656 +result = subprocess.run("ffmpeg -version", shell=True) +assert ( + result.returncode == 0 +), "please install ffmpeg and ensure that it is on your PATH." # Credit: @zmilicc for requesting this. print("All checks passed. Your environment is good to go!") diff --git a/notebooks/00-preface/01-setup.md b/notebooks/00-preface/01-setup.md index cde0a42e..da5360b2 100644 --- a/notebooks/00-preface/01-setup.md +++ b/notebooks/00-preface/01-setup.md @@ -2,9 +2,7 @@ In order to get the most of this book, you will want to be able to execute the examples in the notebooks, -modify them, -break the code, -and fix it. +modify them, break the code, and fix it. Pedagogically, that is the best way for you to learn the concepts. Here are the recommended ways in which you can get set up. @@ -19,16 +17,6 @@ To go there, click on the following button: [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/ericmjl/Network-Analysis-Made-Simple/master) -Once you're in there, do a final setup step, -by opening up a terminal in the Jupyter session, -and installing the custom package `nams` that we wrote, -which contains data loaders and solutions. - -```bash -# In the root directory of the repository -python setup.py develop -``` - ## VSCode Development Containers Assuming that you're using Visual Studio Code