Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff8f88f

Browse files
committed
instructions for common usage error, closes #63
1 parent b6990d3 commit ff8f88f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

ftplugin/python/ipy.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,25 @@ except NameError:
7777
kc = None
7878
pid = None
7979

80+
_install_instructions = """You *must* install IPython into the Python that
81+
your vim is linked against. If you are seeing this message, this usually means
82+
either (1) installing IPython using the system Python that vim is using, or
83+
(2) recompiling Vim against the Python where you already have IPython
84+
installed. This is only a requirement to allow Vim to speak with an IPython
85+
instance using IPython's own machinery. It does *not* mean that the IPython
86+
instance with which you communicate via vim-ipython needs to be running the
87+
same version of Python.
88+
"""
8089
def km_from_string(s=''):
8190
"""create kernel manager from IPKernelApp string
8291
such as '--shell=47378 --iopub=39859 --stdin=36778 --hb=52668' for IPython 0.11
8392
or just 'kernel-12345.json' for IPython 0.12
8493
"""
8594
from os.path import join as pjoin
95+
try:
96+
import IPython
97+
except ImportError:
98+
raise ImportError("Could not find IPython. " + _install_instructions)
8699
from IPython.config.loader import KeyValueConfigLoader
87100
from Queue import Empty
88101
try:

0 commit comments

Comments
 (0)