ipy.vim 脚本有问题
我正在尝试使用 ipy.vim 脚本来设置一个小型 python 开发环境,但遇到了连接问题。当我输入 ipy_vimserver.setup("demo") 时,出现此错误:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/pymodules/python2.6/IPython/Extensions/ipy_vimserver.py", line 109, in serve_me
self.listen()
File "/usr/lib/pymodules/python2.6/IPython/Extensions/ipy_vimserver.py", line 93, in listen
self.socket.bind(self.__sname)
File "<string>", line 1, in bind
error: [Errno 98] Address already in use
当我第二次输入时,一切都很好,但是当我启动 gvim 时,F4/F5 命令不执行任何操作并声明它们无法连接到 Ipython服务器。
有什么建议吗?
I'm trying to use the ipy.vim script to set up a small python dev environment, but I'm running into a connection problem. When I type ipy_vimserver.setup("demo") I get this error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/pymodules/python2.6/IPython/Extensions/ipy_vimserver.py", line 109, in serve_me
self.listen()
File "/usr/lib/pymodules/python2.6/IPython/Extensions/ipy_vimserver.py", line 93, in listen
self.socket.bind(self.__sname)
File "<string>", line 1, in bind
error: [Errno 98] Address already in use
When I type it a second time, everything is fine but when I launch gvim the F4/F5 command do nothing and state that they can't connect to the Ipython server.
any suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果我运行完全相同的代码,我会得到相同的错误。如果我将名称从“demo”更改为“cookies”,它就可以工作。唔....
If I run the exact same code I get the same error. If I change the name from "demo" to, for example, "cookies" it works. Hmm....
当已经存在一个具有您尝试创建的名称(在本例中为“demo”)的套接字时,就会发生这种情况。您需要在执行 ipy_vimserver.setup 之前删除它 - 在您的情况下,要删除的套接字文件是
~/.ipython/demo
(我是 ipy.vim 的作者之一)
This happens when there's already a socket with the name you're trying to create, in this case 'demo'. You need to delete it before doing the ipy_vimserver.setup - in your case, the socket file to delete is
~/.ipython/demo
(I'm one of the authors of ipy.vim)
问题:
查看堆栈跟踪的最后一行:
错误:[Errno 98]地址已在使用中
解释:
<的一个很好的解释code>“地址已在使用中” 错误可以在这里找到: “绑定:地址已正在使用”
可能的解决方案:
由于我自己没有尝试过
ipy.vim
设置,从网络角度来看,一个快速建议是:ipython server
)和客户端(vim running ipy.vim
)。ipython 服务器
ipy.vim
运行 vim 并尝试调试。其他信息:
/proc/sys/net/ipv4/tcp_keepalive_time
和/proc/sys/net/ 中定义ipv4/tcp_fin_time
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpTimedWaitDelay
。更多详细信息请参见:TcpTimedWaitDelayProblem:
Look at the last line of the stack trace:
error: [Errno 98] Address already in use
Explanation:
A nice explanation of
"Address already in use"
error can be found here: "Bind: Address Already in Use"Possible Solution:
As I have not tried
ipy.vim
setup myself, from networking point of view, a quick suggestion would be to:ipython server
) and the client (vim running ipy.vim
).ipython server
ipy.vim
and try to debug.Additional Info:
/proc/sys/net/ipv4/tcp_keepalive_time
and/proc/sys/net/ipv4/tcp_fin_time
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpTimedWaitDelay
. More details is here: TcpTimedWaitDelay