Skip to content

Cannot import jsonschema; works from python #875

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

Closed
jkugler opened this issue Jan 9, 2021 · 1 comment
Closed

Cannot import jsonschema; works from python #875

jkugler opened this issue Jan 9, 2021 · 1 comment

Comments

@jkugler
Copy link

jkugler commented Jan 9, 2021

I am facing a situation similar to #874. I cannot import a module in bpython, but it works fine in python3.

$ which python3
/usr/bin/python3
$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/jkugler/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
>>> import jsonschema
>>> jsonschema.__file__
'/usr/lib/python3/dist-packages/jsonschema/__init__.py'

but

$ bpython
bpython version 0.18 on top of Python 3.8.5 /usr/bin/python3
>>> import sys
>>> sys.path
['', '/usr/bin', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/jkugler/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
>>> import jsonschema
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    import jsonschema
  File "/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py", line 243, in load_module
    module = self.loader.load_module(name)
  File "/usr/lib/python3/dist-packages/jsonschema/__init__.py", line 34, in <module>
    __version__ = metadata.version("jsonschema")
  File "/usr/lib/python3.8/importlib/metadata.py", line 531, in version
    return distribution(distribution_name).version
  File "/usr/lib/python3.8/importlib/metadata.py", line 504, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: jsonschema
@sebastinas
Copy link
Contributor

This issue was fixed in 0.20.

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

No branches or pull requests

2 participants