Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported SSH connection when using PyInstaller #42

Closed
prodangp opened this issue Dec 2, 2020 · 3 comments
Closed

Unsupported SSH connection when using PyInstaller #42

prodangp opened this issue Dec 2, 2020 · 3 comments
Labels
bug something does not work external derives from an external error wontfix associated bug won't be fixed

Comments

@prodangp
Copy link

prodangp commented Dec 2, 2020

I am connecting via SSH using fs.sshfs like this,

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

It is working fine when I run the script using PyCharm. However, when I create my EXE using PyInstaller and I run the executable I get this error:

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

I think that the PyInstaller doesn't include fs.sshfs and I have tried also to run PyInstaller with the following option:

--hidden-import=fs.sshfs

The error persists.

@althonos
Copy link
Owner

althonos commented Dec 2, 2020

Ah yes, I've run into something similar with PyInstaller, where it doesn't play well with the setuptools entry points that I made for Pyfilesystem2 to load external filesystem openers.

If you can register the SSHFS opener somewhere manually with the code below, PyInstaller should be able to pick it in the EXE:

import fs.opener
import fs.opener.sshfs

fs.opener.registry.install(fs.opener.sshfs.SSHOpener)

@althonos althonos added the bug something does not work label Dec 2, 2020
@prodangp
Copy link
Author

prodangp commented Dec 2, 2020

It works now. Thank you!

@althonos althonos added external derives from an external error wontfix associated bug won't be fixed labels Dec 2, 2020
@althonos
Copy link
Owner

althonos commented Dec 2, 2020

Cool! Will close the issue, since this is really a PyInstaller bug. I guess they are aware of it (pyinstaller/pyinstaller#1188) but it does not look they are working on a fix (or even know how to fix it).

@althonos althonos closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something does not work external derives from an external error wontfix associated bug won't be fixed
Projects
None yet
Development

No branches or pull requests

2 participants