I have been trying to fix this issue for a while, but I have not been able to resolve it. I use SublimeREPL with Sublime Text 3. Whenever I try and launch the Ipython shell from SublimeREPL, I get this error:
Traceback (most recent call last):
File "/home/user/.config/sublime-text-3/Packages/SublimeREPL/config/Python/ipy_repl.py", line 51, in <module>
embedded_shell = ZMQTerminalIPythonApp(config=cfg, user_ns={})
File "/usr/lib/python2.7/dist-packages/IPython/core/application.py", line 150, in __init__
super(BaseIPythonApplication, self).__init__(**kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 166, in __init__
SingletonConfigurable.__init__(self, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/config/configurable.py", line 84, in __init__
self.config = config
File "/usr/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 307, in __set__
obj._notify_trait(self.name, old_value, new_value)
File "/usr/lib/python2.7/dist-packages/IPython/utils/traitlets.py", line 458, in _notify_trait
c(name, old_value, new_value)
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 176, in _config_changed
self.log.debug('Config changed:')
AttributeError: 'ZMQTerminalIPythonApp' object has no attribute 'log'
***Repl Closed***
The issue seems to be with this ZMGTerminalIPythonApp object in the application.py module. Ipython works just fine when I load it from the command line.
UPDATE: So I also tried to run the ipy_repl.py file directly from the command line. I was expecting it to fail, but it actually worked just fine. I did not get the error above. So it is not clear why when invoking SublimeREPL from ST3 I get the above error but when I invoke the SublimeREPL ipython shell from the command line, it all works fine.
Has anyone else been able to resolve this issue?
Okay I figured out the problem. It all had to do with my $PATH variable. I use the Anaconda package from Continuum.io for scientific python--great package btw. So Anaconda will update the $PATH variable so that its version of the python binaries comes first in the $PATH and hence is the one that pip
acts against. I knew that Ipython did this with Anaconda, but not the python
too. So when I was updating pyzmq with pip
, that was updating the Anaconda distribution instead of the normal locally installed python install in /usr/bin/ ...
Interestingly, SublimeREPL was trying to invoke the REPL against the python install in /usr/bin/...
instead of just following the normal $PATH variable reference to the Anaconda distribution. I am still not sure how that happened?
So anyway, when I used the easy_install
package installer to upgrade pyzmq
instead of pip
, then this updated the python install in /usr/bin/...
instead of the Anaconda version. That resolved the problem.
So now SublimeREPL is working.