diff --git a/setup.py b/setup.py index c125ec7241710..206cd645afecc 100755 --- a/setup.py +++ b/setup.py @@ -123,6 +123,7 @@ def configuration(parent_package='', top_path=None): os.remove('MANIFEST') from numpy.distutils.misc_util import Configuration + config = Configuration(None, parent_package, top_path) # Avoid non-useful msg: @@ -137,26 +138,6 @@ def configuration(parent_package='', top_path=None): return config -def get_scipy_status(): - """ - Returns a dictionary containing a boolean specifying whether SciPy - is up-to-date, along with the version string (empty string if - not installed). - """ - scipy_status = {} - try: - import scipy - scipy_version = scipy.__version__ - scipy_status['up_to_date'] = parse_version( - scipy_version) >= parse_version(SCIPY_MIN_VERSION) - scipy_status['version'] = scipy_version - except ImportError: - traceback.print_exc() - scipy_status['up_to_date'] = False - scipy_status['version'] = "" - return scipy_status - - def get_numpy_status(): """ Returns a dictionary containing a boolean specifying whether NumPy @@ -206,6 +187,10 @@ def setup_package(): 'Programming Language :: Python :: 3.6', ], cmdclass=cmdclass, + install_requires=[ + 'numpy>={0}'.format(NUMPY_MIN_VERSION), + 'scipy>={0}'.format(SCIPY_MIN_VERSION) + ], **extra_setuptools_args) if len(sys.argv) == 1 or ( @@ -229,9 +214,6 @@ def setup_package(): numpy_status = get_numpy_status() numpy_req_str = "scikit-learn requires NumPy >= {0}.\n".format( NUMPY_MIN_VERSION) - scipy_status = get_scipy_status() - scipy_req_str = "scikit-learn requires SciPy >= {0}.\n".format( - SCIPY_MIN_VERSION) instructions = ("Installation instructions are available on the " "scikit-learn website: " @@ -247,16 +229,6 @@ def setup_package(): raise ImportError("Numerical Python (NumPy) is not " "installed.\n{0}{1}" .format(numpy_req_str, instructions)) - if scipy_status['up_to_date'] is False: - if scipy_status['version']: - raise ImportError("Your installation of Scientific Python " - "(SciPy) {0} is out-of-date.\n{1}{2}" - .format(scipy_status['version'], - scipy_req_str, instructions)) - else: - raise ImportError("Scientific Python (SciPy) is not " - "installed.\n{0}{1}" - .format(scipy_req_str, instructions)) from numpy.distutils.core import setup