From 7ff5a4afe2d7a40dce34ae187a23b7d0feba33ba Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Thu, 16 Oct 2014 15:26:58 +0200 Subject: catch ImportError in setup.py --- setup.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index a9f40bd..fc8d0d2 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,23 @@ Handles the compilation of pyx source files +run as: +python setup.py build_ext --inplace + Copyright 2014, Mario Mulansky Distributed under the BSD License """ from distutils.core import setup -from Cython.Build import cythonize import numpy -setup( - ext_modules=cythonize("pyspike/*.pyx"), - include_dirs=[numpy.get_include()] -) +try: + from Cython.Build import cythonize + setup( + ext_modules=cythonize("pyspike/*.pyx"), + include_dirs=[numpy.get_include()] + ) +except ImportError: + print("Error: Cython is not installed! You will only be able to use the \ +much slower Python backend in PySpike.") -- cgit v1.2.3