Skip to content
Snippets Groups Projects
Commit baae4702 authored by Christoph Groth's avatar Christoph Groth
Browse files

provide clear error message when trying to import from the source distribution

parent e3f26674
Branches
Tags
No related merge requests found
......@@ -8,6 +8,14 @@
import numpy # Needed by C. Gohlke's Windows package.
try:
from . import _system
except ImportError:
msg = """Error importing Kwant: You should not try to import Kwant from
its source directory. Please exit the Kwant source tree, and relaunch
your Python intepreter from there."""
raise ImportError(msg)
__all__ = ['system', 'version', 'builder', 'lattice', 'solvers',
'digest', 'rmt']
for module in __all__:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment