ipy.vim 脚本有问题

发布于 2024-11-04 10:27:49 字数 691 浏览 1 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

少女七分熟 2024-11-11 10:27:50

如果我运行完全相同的代码,我会得到相同的错误。如果我将名称从“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....

空城之時有危險 2024-11-11 10:27:50

当已经存在一个具有您尝试创建的名称(在本例中为“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)

逆蝶 2024-11-11 10:27:49

问题:

查看堆栈跟踪的最后一行:错误:[Errno 98]地址已在使用中

解释:

<的一个很好的解释code>“地址已在使用中” 错误可以在这里找到: “绑定:地址已正在使用”

可能的解决方案:

由于我自己没有尝试过 ipy.vim 设置,从网络角度来看,一个快速建议是:

  • close/杀死服务器(ipython server)和客户端(vim running ipy.vim)。
  • 重新启动 ipython 服务器
  • 使用 ipy.vim 运行 vim 并尝试调试。

其他信息:

  • 在 Linux/Unix 机器上,超时值在 /proc/sys/net/ipv4/tcp_keepalive_time/proc/sys/net/ 中定义ipv4/tcp_fin_time
  • 在 Windows 机器上,这是在HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpTimedWaitDelay。更多详细信息请参见:TcpTimedWaitDelay

Problem:

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:

  • close/kill both the server (ipython server) and the client (vim running ipy.vim).
  • Restart ipython server
  • Run vim with ipy.vim and try to debug.

Additional Info:

  • On Linux/Unix machines, the timeout values are defined in /proc/sys/net/ipv4/tcp_keepalive_time and /proc/sys/net/ipv4/tcp_fin_time
  • On Windows machines, this is set in HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpTimedWaitDelay. More details is here: TcpTimedWaitDelay
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文