In [ ]:
%matplotlib inline
error_count = 0
things_not_installed = []
try:
import numpy as np
except ImportError:
things_not_installed.append("numpy")
try:
import scipy
except ImportError:
things_not_installed.append("scipy")
try:
import matplotlib
from matplotlib import pyplot as plt
plt.plot([-1.5,1.5],[15,15],"o",ms=20)
x = [i*0.1 for i in range(-21,21)]
y = [i**2 for i in x]
plt.plot(x,y,'r-',lw=15)
plt.title("plotting graphics installed correctly")
plt.xlim((-5,5))
plt.ylim((-5,20))
plt.show()
except ImportError:
things_not_installed.append("matplotlib")
try:
import pandas
except ImportError:
things_not_installed.append("pandas")
try:
import sklearn
except ImportError:
things_not_installed.append("scikit-learn")
if len(things_not_installed) == 0:
print("SUCCESS. Environment is configured correctly.")
else:
print("ERROR. The following packages are not installed.")
for t in things_not_installed:
print(" * {}".format(t))
print()
print("To install the missing packages, open your conda terminal and type:")
print()
print(" conda install {}".format(" ".join(things_not_installed)))
print()
print("After this is finished. Got to Kernel->Restart above and")
print("try running the notebook again.")
In [ ]: