Skip to content

Commit

Permalink
Small fixes for check environment script. (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmjl authored May 16, 2022
1 parent 8f6b023 commit a6bc453
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
13 changes: 8 additions & 5 deletions checkenv.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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!")
14 changes: 1 addition & 13 deletions notebooks/00-preface/01-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand Down

0 comments on commit a6bc453

Please sign in to comment.