-
Notifications
You must be signed in to change notification settings - Fork 276
Expand file tree
/
Copy pathcheckenv.py
More file actions
37 lines (29 loc) · 709 Bytes
/
checkenv.py
File metadata and controls
37 lines (29 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Check that the packages are installed.
from pkgutil import iter_modules
import sys
def check_import(packagename):
if packagename in (name for _, name, _ in iter_modules()):
return True
else:
return False
assert (
sys.version_info.major >= 3 and sys.version_info.minor >= 6
), "Please install Python 3.6!"
packages = [
"jupyter",
"pymc3",
"seaborn",
"matplotlib",
"numpy",
"scipy",
"pandas",
"tqdm",
"jupyterlab",
]
all_passed = True
for p in packages:
assert check_import(
p
), "{0} not present. Please install via pip or conda.".format(p)
if all_passed:
print("All checks passed. Your environment is good to go!")