summaryrefslogtreecommitdiff
path: root/numpy/__init__.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-03-13 07:29:56 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-03-13 07:29:56 +0000
commitf50f4b46987fd3a176e432c1a25bcc184afc24ef (patch)
tree42cd170cba19ff07ec39b7ebb0c00be5f656d815 /numpy/__init__.py
parentfd6d555f8e4cf04871c1c1ed71ad53e2b6009164 (diff)
downloadnumpy-f50f4b46987fd3a176e432c1a25bcc184afc24ef.tar.gz
Put a more meaningful message when importing numpy from its source tree.
Diffstat (limited to 'numpy/__init__.py')
-rw-r--r--numpy/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py
index a62e3c943..869a592d8 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -24,7 +24,13 @@ if __NUMPY_SETUP__:
print >> _sys.stderr, 'Running from numpy source directory.'
del _sys
else:
- from numpy.__config__ import show as show_config
+ try:
+ from numpy.__config__ import show as show_config
+ except ImportError, e:
+ msg = """Error importing numpy: you should not try to import numpy from
+ its source directory; please exit the numpy source tree, and relaunch
+ your python intepreter from there."""
+ raise ImportError(msg)
from version import version as __version__
from _import_tools import PackageLoader