ivanov / vim-ipython

A two-way integration between Vim and IPython 0.11+
http://github.com/ivanov/vim-ipython
1.04k stars 163 forks source link

Traceback and NameError on anaconda python 2.7 #113

Open hayd opened 9 years ago

hayd commented 9 years ago

I'm new to vim, please forgive me if I have done something silly (hopefully that's the case!).

I get this error when I run :IPython:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/andy/.vim/bundle/vim-ipython/ftplugin/python/vim_ipython.py", line 151, in km_from_string
    km.load_connection_file()
  File "/Users/andy/anaconda/lib/python2.7/site-packages/IPython/kernel/connect.py", line 495, in load_connection_file
    cfg = json.loads(f.read())
  File "/Users/andy/anaconda/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/Users/andy/anaconda/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/andy/anaconda/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

and ctrl+s:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/andy/.vim/bundle/vim-ipython/ftplugin/python/vim_ipython.py", line 478, in f_with_update
    f(*args)
  File "/Users/andy/.vim/bundle/vim-ipython/ftplugin/python/vim_ipython.py", line 513, in run_this_line
    msg_id = send(line)
NameError: global name 'send' is not defined

Note: I have an ipython (2.1.0) console open.

shanechin commented 9 years ago

I'm also having the same issue, did you ever get it resolved?

shanechin commented 9 years ago

Ah, this happens before you initialize with :Ipython in your vim session. I assumed this only needed to be done once, and only when you sourced the file. It needs to happen every time.

paolodina commented 9 years ago

I'm stuck at the same point, any workaround?

Thomas-van-Dijk commented 8 years ago

Same for me..

spencerns commented 8 years ago

same for me.

sfuller1979 commented 7 years ago

same for me

ivanov commented 7 years ago

Do you have an ipython kernel running? vim-ipython does not currently start a new kernel, it can only connect to kernels that have already been started via either ipython kernel or ipython console or by opening up a notebook file in jupyter