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

ModuleNotFoundError: No module named 'fs.sshfs' - Setup.py install not working for some reason #49

Closed
visch opened this issue Jun 30, 2021 · 3 comments
Labels
invalid issue is not a valid issue

Comments

@visch
Copy link

visch commented Jun 30, 2021

This is certainly me misunderstanding something, but I haven't been able to figure it out.

Error: ModuleNotFoundError: No module named 'fs.sshfs'

Replication steps:

  1. Setup a new venv (Python 3.8.5)
  2. Run python setup.py install (With setup.py below)
  3. Open up your interpreter (or anything) and run from fs.sshfs import SSHFS

The part that is really throwing me for a loop is this

  1. After doing those steps run pip install fs.sshfs , pip will let you know you have all the requirements (But if you test with the python interpreter you will see this still doesn't' work)
  2. Install a new venv
  3. Run pip install fs.sshfs
  4. Now running from fs.sshfs import SSHFS works perfectly fine!

Very confusing for me. I'm trying to extend https://github.com/hotgluexyz/target-csv , but I"m not having very much luck. I'm going to dump fs.sshfs right now for using paramiko directly unfortunately due to this issue :/

Full error


Python 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fs.sshfs import SSHFS
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'fs.sshfs'

setup.py

#!/usr/bin/env python

from setuptools import setup

setup(name='target-csv',
      version='0.3.3',
      description='Singer.io target for writing CSV files',
      author='Stitch',
      url='https://singer.io',
      classifiers=['Programming Language :: Python :: 3 :: Only'],
      py_modules=['target_csv'],
      install_requires=[
          'fs.sshfs==1.0.0',
          'jsonschema==2.6.0',
          'singer-python>=5.1.0,<=5.3.1',
      ],
      entry_points='''
          [console_scripts]
          target-csv=target_csv:main
      ''',
)
@visch visch mentioned this issue Jun 30, 2021
2 tasks
@althonos
Copy link
Owner

Just tested, that's because running python setup.py install is going to install the libraries as eggs, which is an outdated format that doesn't support namespace packages (which are needed for fs.sshfs to install properly). When you do a pip install, it works because the packages are installed as wheels.

There's not much I can do on my end, as the whole python setup.py install is kinda deprecated in favor of pip. On yours, you can try using pip install -e . instead of python setup.py install, which will install your project in "editable" mode, which will install the dependencies in the virtualenv.

@visch
Copy link
Author

visch commented Jun 30, 2021

Just tested, that's because running python setup.py install is going to install the libraries as eggs, which is an outdated format that doesn't support namespace packages (which are needed for fs.sshfs to install properly). When you do a pip install, it works because the packages are installed as wheels.

There's not much I can do on my end, as the whole python setup.py install is kinda deprecated in favor of pip. On yours, you can try using pip install -e . instead of python setup.py install, which will install your project in "editable" mode, which will install the dependencies in the virtualenv.

Thank you so much for taking a look! I was afraid this was the case.

So is it really the case that python setup.py install is dead and the library at target-csv should just update to something else? Like Poetry or something

Or is it that me as a Developer just needs to stop using python setup.py install and use pip install -e . . Sounds like the latter is what should happen. I'm a new Python Developer so this is probably what's going on!

@visch
Copy link
Author

visch commented Jun 30, 2021

Thank you for the help, it's really just me. I need to use pip install . when developing locally. I didn't realize this was the right way to do this.

Learned a bunch at a minimum!

@visch visch closed this as completed Jun 30, 2021
@althonos althonos added the invalid issue is not a valid issue label Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid issue is not a valid issue
Projects
None yet
Development

No branches or pull requests

2 participants