使用 PyInstaller 时不支持 SSH 连接

Unsupported SSH connection when using PyInstaller

我正在使用 fs.sshfs 通过 SSH 连接,

  my_fs = fs.open_fs(u'ssh://myuser:mypassword@my.server.com:22/share/directory/')

当我 运行 使用 PyCharm 的脚本时它工作正常。但是,当我使用 PyInstaller 创建我的 EXE 并且我 运行 可执行文件时,我收到此错误:

fs.opener.errors.UnsupportedProtocol: protocol 'ssh' is not supported

我认为 PyInstaller 不包含 fs.sshfs,我也尝试 运行 PyInstaller 使用以下选项:

--nowindow --hidden-import=fs.sshfs 

错误仍然存​​在。

这似乎是 PyInstaller 的错误。您可以在此处找到修复: https://github.com/althonos/fs.sshfs/issues/42