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

Bug - python3.8 some imports which are using metadata module doesn't work #807

Closed
uriariel opened this issue May 27, 2020 · 2 comments
Closed

Comments

@uriariel
Copy link
Contributor

@uriariel uriariel commented May 27, 2020

After upgrading to python3.8 I've started to encounter a strange error, when I'm importing some modules (for example jsonschema) I'm getting a importlib.metadata.PackageNotFoundError.
And when using vanilla python shell everything is working fine.

`bpython3 -p (echo 'import jsonschema' | psub )
bpython version 0.18 on top of Python 3.8.2 /usr/bin/python3

import jsonschema
Traceback (most recent call last):
File "", line 1, in
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/local/lib/python3.8/dist-packages/jsonschema/init.py", line 34, in
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`

python3 -i (echo 'import jsonschema; print("ok")' | psub ) ok

uriariel added a commit to uriariel/bpython that referenced this issue May 27, 2020
@uriariel
Copy link
Contributor Author

@uriariel uriariel commented May 27, 2020

I've made a pull request fixing this issue

@sebastinas
Copy link
Contributor

@sebastinas sebastinas commented May 28, 2020

Thanks for the PR.

@sebastinas sebastinas closed this May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.