简体   繁体   English

如何解决ipython-listener和/或gedit的ipython插件问题?

[英]How do I troubleshoot ipython-listener and/or gedit's ipython plugin?

I am running Gedit 3.8.3, Python 2.7.5+ and IPython 0.13.2 and the Gedit Ipython Plugin . 我正在运行Gedit 3.8.3,Python 2.7.5+和IPython 0.13.2和Gedit Ipython插件

I know there are better IDEs for Python out there but this used to "just work" and then I got a new machine and installed Ubuntu 13.10 and it doesn't work anymore. 我知道那里有适用于Python的更好的IDE,但这曾经可以“正常工作”,然后我得到了一台新机器并安装了Ubuntu 13.10,它不再工作了。 The plugin used to give me an error, (gedit:23136): libpeas-WARNING **: Could not find loader 'python' for plugin 'ipython' but I followed some advice on AskUbuntu and edited the Loader line in /usr/lib/gedit/plugins/ipython.plugin to Loader=python3 and it now loads without error but also doens't do anything. 插件曾经给我一个错误, (gedit:23136): libpeas-WARNING **: Could not find loader 'python' for plugin 'ipython'但是我遵循了AskUbuntu的一些建议并在/usr/lib/gedit/plugins/ipython.plugin编辑了Loader行/usr/lib/gedit/plugins/ipython.pluginLoader=python3 ,它现在可以正确加载,但也不会任何事情。 Whether or not iPython-listener is running, the error I see in the console is 无论iPython-listener是否正在运行,我在控制台中看到的错误是

Traceback (most recent call last):
  File "/usr/lib/gedit/plugins/ipython.py", line 98, in send_to_ipython
    self.socket.sendto(code, (self.listener_host, self.listener_port) )     
TypeError: 'str' does not support the buffer interface

Is there a way to get this working? 有没有办法让这个工作?

Reposting as an answer: 重新发布作为答案:

The gedit IPython plugin appears to be written for Python 2 only, but it looks like it only takes a small change to adapt it to Python 3. Find the line on which the error occurred: gedit IPython插件似乎仅是为Python 2编写的,但看起来只需要很小的改动就可以使其适应Python3。找到发生错误的行:

self.socket.sendto(code, (self.listener_host, self.listener_port) )

And change it to this: 并将其更改为:

self.socket.sendto(code.encode('utf-8'), (self.listener_host, self.listener_port) )

UTF-8 should be the right default on most modern Linux systems. 在大多数现代Linux系统上,UTF-8应该是正确的默认设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM