forked from ericmjl/bayesian-stats-modelling-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcheckenv.py
More file actions
24 lines (17 loc) · 668 Bytes
/
checkenv.py
File metadata and controls
24 lines (17 loc) · 668 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
# 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!')