Closed nilsbecker closed 11 years ago
if IPython.zmq cannot be imported, you need to install pyzmq into your system python in order to use the IPython.zmq machinery from vim-ipython. The current version of vim-ipython works with all versions of ipython from 0.11 to current git master.
hi, i have pyzmq installed in the system python already: /usr/bin/python
import zmq [succeeds] import IPython [succeeds] import IPython.zmq [fails]
ok, it just found this:
/usr/bin/python
import zmq [succeeds] import IPython [succeeds] import IPython.zmq [fails] import IPython.kernel.zmq [succeeds] IPython.version '1.1.0'
in the module IPython.kernel.zmq there is no submodule blockingkernelmanager. instead, IPython.kernel has a bunch of submodules called manager and the like. it really seems the code has been refactored ?!
. it really seems the code has been refactored ?!
@nilsbecker this is indeed the case, but there are enough safeguards such that vim-ipython continues to work with IPython 1.1.0
hmm, then i must be doing something wrong. i just don't see what: i installed zmq into the system python as suggested and confirmed by the successful import of zmq. still i can't seem to get it to work.
just for completeness:
system python as running in vim: 2.7.2 (os x 10.7) with ipython 1.1.0 and zmq 13.1.0 installed via easy_install / pip
'user' python: current anaconda 2.7.5 with ipython 1.0.0 and zmq 2.2.0.1
(from sys.version
and zmq.__version__
)
in vim:
:source ~/.vim/bundle/vim-ipython/ftplugin/python/ipy.vim
:IPython
gives
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 39, in km_from_string
ImportError: No module named zmq.blockingkernelmanager
@nilsbecker are you using the latest version of vim-ipython? The latest relavant section of km_from_string
looks something like this:
try:
from IPython.kernel import (
KernelManager,
find_connection_file,
)
except ImportError:
# IPython < 1.0
from IPython.zmq.blockingkernelmanager import BlockingKernelManager as KernelManager
from IPython.zmq.kernelapp import kernel_aliases
try:
from IPython.lib.kernel import find_connection_file
except ImportError:
# < 0.12, no find_connection_file
pass
So you should not end up on the utilizing zmq.blockingkernelmanager branch at all. I wonder if you're still using some old tarball that I put up on vim.org a long time ago and haven't updated.
ok, thanks for the help; i had the newest vim-ipython (via vundle) but somehow my macvim installation was messed up. i reinstalled the newest snapshot (72) and suddenly everything is peachy! full functionality as advertised! since this issue showed up on two computers, maybe it's really something that was fixed in macvim recently and not just user error - i don't know.
sweet, glad to hear it, closing!
just for the record: it seems that an old vim-ipython was indeed the problem. somehow vundle did not properly overwrite the old ipy.vim even though the current github repository was correctly listed in the bundle list in .vimrc
Had the same problem. For some reason vundle uses this repo and I guess it's outdated: https://github.com/vim-scripts/vim-ipython.git
@focs is right. i had the same problem. After I chose to install the "Bundle ivanov/vim-ipython", the problem was solved.
good to know, i will update my vimrc.
Glad to see you all helping one another out! Is this something that can be addressed in vundle? (sorry, i've never used it)
hi,
i followed the installation guide and installed ipython (and zmq) on the system python on my mac OS 10.8.
in addition, anaconda python is installed and overrides the system python in the $PATH.
i use MacVim which is compiled against the system python. both /usr/bin/python and :py inside mvim can import IPython just fine. also, their sys.path agrees.
but: IPython.zmq cannot be imported at all, and after sourcing vim.ipy, i cannot connect to an existing kernel with the message about IPython.zmq.blockingkernelmanager not being found.
has the ipython module architecture changed? i am using vim-ipython from Vundle