Skip to content

Commit 02a832f

Browse files
committed
made setup.py robust when ez_setup not there
1 parent 1dc3f66 commit 02a832f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
import ez_setup
2-
ez_setup.use_setuptools()
1+
try:
2+
from setuptools import setup
3+
except ImportError:
4+
try:
5+
import ez_setup
6+
ez_setup.use_setuptools()
7+
except ImportError:
8+
raise ImportError("Gizeh could not be installed, probably because"
9+
" neither setuptools nor ez_setup are installed on this computer."
10+
"\nInstall ez_setup ([sudo] pip install ez_setup) and try again.")
311

412
from setuptools import setup, find_packages
513

0 commit comments

Comments
 (0)