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 'jsonschema' #63

Open
moi90 opened this issue Dec 9, 2022 · 4 comments · May be fixed by #64
Open

ModuleNotFoundError: No module named 'jsonschema' #63

moi90 opened this issue Dec 9, 2022 · 4 comments · May be fixed by #64

Comments

@moi90
Copy link

moi90 commented Dec 9, 2022

I installed singularity-compose using pip install --user -U singularity-compose.

When running singularity-compose check, I get:

$ singularity-compose check
Traceback (most recent call last):
  File "/home/guest/sischr001/.local/bin/singularity-compose", line 8, in <module>
    sys.exit(start())
  File "/home/guest/sischr001/.local/lib/python3.8/site-packages/scompose/client/__init__.py", line 252, in start
    from scompose.client.check import main
  File "/home/guest/sischr001/.local/lib/python3.8/site-packages/scompose/client/check.py", line 13, in <module>
    from scompose.config.schema import validate_config
  File "/home/guest/sischr001/.local/lib/python3.8/site-packages/scompose/config/schema.py", line 14, in <module>
    from jsonschema.exceptions import ValidationError
ModuleNotFoundError: No module named 'jsonschema'

After pip install --user -U jsonschema, it works:

$ singularity-compose check
singularity-compose.yml is valid.

It seems that jsonschema should be included in INSTALL_REQUIRES (/scompose/version.py).

@vsoch
Copy link
Member

vsoch commented Dec 9, 2022

@moi90 this was intended to be an optional command you install with:

pip install singularity-compose[check]

We have a few options here:

  • Add this better to the documentation
  • Make jsonschema globally required

Are you suggesting the latter as the best approach? The only command that needs to import this file is the one you ran so I'm hesitant to do the latter but definitely we can chat about it.

@vsoch vsoch linked a pull request Dec 9, 2022 that will close this issue
@vsoch
Copy link
Member

vsoch commented Dec 9, 2022

@moi90
Copy link
Author

moi90 commented Dec 12, 2022

Hmm, if you don't want to make it a global requirement (Why not? It isn't large, I assume), I would catch the ModuleNotFoundError and instruct the user to install it manually.
But I still find it weird to provide a command that can not be executed without additional steps...

@vsoch
Copy link
Member

vsoch commented Dec 12, 2022

That’s exactly what would have happened if there wasn’t a stray input put before that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants