Skip to content

Commit dc1af56

Browse files
Kh4Lzhreshold
authored andcommitted
Handle no Cython error in setup.py (#931)
Signed-off-by: Serge Panev <spanev@nvidia.com>
1 parent 384f30e commit dc1af56

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55
import sys
66

77
import numpy as np
8-
from Cython.Build import cythonize
8+
try:
9+
from Cython.Build import cythonize
10+
except ImportError:
11+
cythonize = None
912
from setuptools import setup, find_packages, Extension
1013

1114
with_cython = False
1215
if '--with-cython' in sys.argv:
16+
if not cythonize:
17+
print("Cython not found, please run `pip install Cython`")
18+
exit(1)
1319
with_cython = True
1420
sys.argv.remove('--with-cython')
1521

0 commit comments

Comments
 (0)