From dc1af56fe38b4648fe0c995faadf9c1f368fa29c Mon Sep 17 00:00:00 2001 From: Serge Panev Date: Fri, 6 Sep 2019 19:57:01 +0200 Subject: [PATCH] Handle no Cython error in setup.py (#931) Signed-off-by: Serge Panev --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5e0f393487..b9b0460cb0 100644 --- a/setup.py +++ b/setup.py @@ -5,11 +5,17 @@ import sys import numpy as np -from Cython.Build import cythonize +try: + from Cython.Build import cythonize +except ImportError: + cythonize = None from setuptools import setup, find_packages, Extension with_cython = False if '--with-cython' in sys.argv: + if not cythonize: + print("Cython not found, please run `pip install Cython`") + exit(1) with_cython = True sys.argv.remove('--with-cython')