2013-12-21 23 views
1

我正在運行Gedit 3.8.3,Python 2.7.5+和IPython 0.13.2和Gedit Ipython Plugin如何解決ipython-listener和/或gedit的ipython插件問題?

我知道那裏有更好的Python IDE,但是這用於「只是工作」,然後我得到一臺新機器並安裝了Ubuntu 13.10,它不再工作。該插件曾給我一個錯誤,但我跟着some advice on AskUbuntu,並編輯了裝載程序行/usr/lib/gedit/plugins/ipython.pluginLoader=python3,它現在加載沒有錯誤,但也doens't 什麼。 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 

有沒有辦法得到這個工作?

+0

嘗試使用該行代碼打開文件並將'code'更改爲'code.encode('utf-8')'。 –

+0

賓果!如果你做出這個答案,我可以接受它。 – Amanda

+0

我也在插件上打開了一個問題:https://github.com/smathot/gedit-plugin-ipython/issues/2 –

回答

0

轉貼作爲一個答案:

IPython的插件出現的Python只有2被寫入在gedit,但它看起來像只需要一個小的變化,以使其適應的Python 3.查找線路上的錯誤發生:

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

它改成這樣:

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

UTF-8應該是最現代的Linux系統的默認權。