File tree 1 file changed +23
-0
lines changed 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,19 @@ def configuration(parent_package='', top_path=None):
114
114
115
115
return config
116
116
117
+ def is_scipy_installed ():
118
+ try :
119
+ import scipy
120
+ except ImportError :
121
+ return False
122
+ return True
123
+
124
+ def is_numpy_installed ():
125
+ try :
126
+ import numpy
127
+ except ImportError :
128
+ return False
129
+ return True
117
130
118
131
def setup_package ():
119
132
metadata = dict (name = DISTNAME ,
@@ -162,6 +175,16 @@ def setup_package():
162
175
163
176
metadata ['version' ] = VERSION
164
177
else :
178
+ if is_numpy_installed () is False :
179
+ raise ImportError ("Numerical Python (NumPy) is not installed.\n "
180
+ "scikit-learn requires NumPy.\n "
181
+ "Installation instructions are available on scikit-learn website: "
182
+ "http://scikit-learn.org/stable/install.html\n " )
183
+ if is_scipy_installed () is False :
184
+ raise ImportError ("Scientific Python (SciPy) is not installed.\n "
185
+ "scikit-learn requires SciPy.\n "
186
+ "Installation instructions are available on scikit-learn website: "
187
+ "http://scikit-learn.org/stable/install.html\n " )
165
188
from numpy .distutils .core import setup
166
189
167
190
metadata ['configuration' ] = configuration
You can’t perform that action at this time.
0 commit comments