File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -104,8 +104,19 @@ def configuration(parent_package='', top_path=None):
104
104
105
105
return config
106
106
107
+ def is_Numpy_installed ():
108
+ try :
109
+ import numpy
110
+ except ImportError :
111
+ return False
107
112
108
113
def setup_package ():
114
+
115
+ build_requires = []
116
+ is_numpy_installed = is_Numpy_installed ()
117
+ if is_numpy_installed is False :
118
+ build_requires = ['numpy>=1.6.2' ]
119
+
109
120
metadata = dict (name = DISTNAME ,
110
121
maintainer = MAINTAINER ,
111
122
maintainer_email = MAINTAINER_EMAIL ,
@@ -134,6 +145,7 @@ def setup_package():
134
145
'Programming Language :: Python :: 3.4' ,
135
146
],
136
147
cmdclass = {'clean' : CleanCommand },
148
+ install_requires = build_requires ,
137
149
** extra_setuptools_args )
138
150
139
151
if (len (sys .argv ) >= 2
@@ -152,6 +164,10 @@ def setup_package():
152
164
153
165
metadata ['version' ] = VERSION
154
166
else :
167
+ if is_numpy_installed is False :
168
+ sys .stderr .write ("[Error] Numpy is required to setup scikit-learn\n "
169
+ "Please install numpy from http://numpy.org\n " )
170
+ sys .exit (1 )
155
171
from numpy .distutils .core import setup
156
172
157
173
metadata ['configuration' ] = configuration
You can’t perform that action at this time.
0 commit comments