From 53b08c40dc9adec5214c745ffa8453e78a652135 Mon Sep 17 00:00:00 2001 From: Ben Bonenfant Date: Mon, 21 Jan 2019 13:32:00 -0500 Subject: [PATCH] Bootstrap numpy installation. --- setup.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.py b/setup.py index 3964f41..4b07221 100755 --- a/setup.py +++ b/setup.py @@ -3,6 +3,14 @@ import sys import setuptools import socket +# Bootstrap a numpy installation before trying to import it. +import imp +try: + imp.find_module('numpy') +except ImportError: + import subprocess + subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy']) + if not socket.gethostname().startswith("cheyenne"): import numpy.distutils.core else: