-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcheck_environment.py
47 lines (39 loc) · 1.55 KB
/
check_environment.py
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
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Imports all packages required for the block course "Advanced Geoscripting"
"""
__author__ = "Christina Ludwig, GIScience Research Group, Heidelberg University"
__email__ = "christina.ludwig@uni-heidelberg.de"
def check_packages():
"""
Checks whether all required packages for the course are available
:return:
"""
try:
import numpy
import geopandas
import rasterio
import requests
import pylint
import pytest
import cython
import sklearn
import scipy
import seaborn
import plotly
except ModuleNotFoundError as e:
print("Ups, something went wrong! There was an error importing the package '{}': '{}'".format(e.name, e))
print("Seems like it is not installed in your environment. How to solve this problem: "
"\n1. Make sure that the correct anaconda environment is activated and run this program again. "
"\n2. If you still get this error, install the missing package using 'conda install {}'. "
"\n3. If you still get this error, write a post in the course "
"forum (https://github.com/orgs/geoscripting/teams/advanced-geoscripting-2020).".format(e.name, e.name))
return 1
print("Great! All required Python packages were found. You're ready for the course!")
return 1
def main():
print("Checking required packages. This may take a few seconds ... ")
check_packages()
return 0
if __name__ == "__main__":
main()