File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-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,18 @@ def setup_package():
162
175
163
176
metadata ['version' ] = VERSION
164
177
else :
178
+ if is_numpy_installed () is False :
179
+ sys .stderr .write ("Error: Numerical Python(NumPy) is not installed.\n "
180
+ "scikit-learn requires NumPy.\n "
181
+ "Instruction installations are available on scikit-learn website:\
182
+ http://scikit-learn.org/stable/install.html\n " )
183
+ sys .exit (1 )
184
+ if is_scipy_installed () is False :
185
+ sys .stderr .write ("Error: Scientific Python(SciPy) is not installed.\n "
186
+ "scikit-learn requires SciPy.\n "
187
+ "Instruction installations are available on scikit-learn website:\
188
+ http://scikit-learn.org/stable/install.html\n " )
189
+ sys .exit (1 )
165
190
from numpy .distutils .core import setup
166
191
167
192
metadata ['configuration' ] = configuration
You can’t perform that action at this time.
0 commit comments