[Numpy-svn] r4868 - trunk/numpy

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Mar 13 03:30:11 EDT 2008


Author: cdavid
Date: 2008-03-13 02:29:56 -0500 (Thu, 13 Mar 2008)
New Revision: 4868

Modified:
   trunk/numpy/__init__.py
Log:
Put a more meaningful message when importing numpy from its source tree.

Modified: trunk/numpy/__init__.py
===================================================================
--- trunk/numpy/__init__.py	2008-03-13 04:44:55 UTC (rev 4867)
+++ trunk/numpy/__init__.py	2008-03-13 07:29:56 UTC (rev 4868)
@@ -24,7 +24,13 @@
     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




More information about the Numpy-svn mailing list