为什么我在使用 Fabric python 库时收到低级套接字错误?

2024-01-07

当我运行命令时:

fab -H localhost host_type

我收到以下错误:

[localhost] Executing task 'host_type'
[localhost] run: uname -s

Fatal error: Low level socket error connecting to host localhost: Connection refused

Aborting.

有什么想法吗?谢谢。

Fabfile.py

from fabric.api import run
def host_type():
    run('uname -s')

配置

  • Fabric 1.0a0(从安装最近的 Github 提交---b8e1b6a http://github.com/cumulusware/fabric/commit/b8e1b6ac3f43787375bb77c1a64d7f9c000e7511)
  • 帕拉米科 1.7.4
  • PyCrypto 2.0.1
  • Virtualenv 版本 1.3.3
  • Python 2.6.2+(release26-maint:74924,2009 年 9 月 18 日,16:03:18)
  • Mac OS X 10.6.1

重要的部分不是消息的“低级错误”部分 - 重要的部分是“连接被拒绝”部分。尝试连接到关闭的端口时,您将收到“连接被拒绝”消息。

最可能的情况是 Fabric 运行时您的计算机上没有运行 ssh 服务器。如果你这样做

ssh localhost

您可能会收到类似以下内容的消息

ssh: connect to host localhost: Connection refused

因此,您必须先在计算机上设置 SSH 服务器,然后才能从那里继续使用 Fabric。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么我在使用 Fabric python 库时收到低级套接字错误? 的相关文章

随机推荐