importlib.metadata.PackageNotFoundError: jsonschema
See original GitHub issue(Maybe related to #1068, closed yesterday)
When running a small script compiled in standalone mode, I get:
Traceback (most recent call last):
File "[...]/test.dist/jsonschema_test.py", line 1, in <module>
File "[...]/test.dist/jsonschema/__init__.py", line 34, in <module jsonschema>
File "[...]/test.dist/importlib/metadata.py", line 551, in version
File "[...]/test.dist/importlib/metadata.py", line 524, in distribution
File "[...]/test.dist/importlib/metadata.py", line 187, in from_name
importlib.metadata.PackageNotFoundError: jsonschema
Python installed with anaconda in dedicated environment.
$ python -m nuitka --version
0.6.15
Python: 3.9.5 (default, May 18 2021, 12:31:01)
Executable: /Users/mesca/anaconda3/envs/nuitka/bin/python
OS: Darwin
Arch: x86_64
I have the same issue when using the develop branch (v0.6.16rc1).
$ python -m pip freeze | grep jsonschema
jsonschema==3.2.0
Minimal example:
from jsonschema import validate
if __name__ == "__main__":
schema = {
"type" : "object",
"properties" : {
"foobar" : {"type" : "number"}
}
}
validate(instance={"foobar": 42}, schema=schema)
Nuitka output:
Nuitka-Options:INFO: Used command line options: --standalone --plugin-enable=pkg-resources test.py
Nuitka:INFO: Starting Python compilation with Nuitka '0.6.16rc1' on Python '3.9' commercial None.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'tkinter' added '_tkinter'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'socket' added '_socket'.
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'ctypes' added '_ctypes'.
Nuitka:INFO: Completed Python level compilation and optimization.
Nuitka:INFO: Generating source code for C backend compiler.
Nuitka:INFO: Running data composer tool for optimal constant value handling.
Nuitka:INFO: Running C level backend compilation via Scons.
Nuitka-Scons:INFO: Backend C compiler: clang (clang).
Nuitka-Scons:INFO: Compiled 56 C files using ccache.
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'disabled': 1
Nuitka-Scons:INFO: Cached C files (using ccache) with result 'cache miss': 55
Nuitka-Plugins:INFO: data-files: Included data dir 'jsonschema/schemas' with 4 files due to package data for 'jsonschema'.
Nuitka-Plugins:INFO: data-files: Included data file 'lib2to3/Grammar3.9.5.final.0.pickle' due to package data for 'lib2to3.pgen2'.
Nuitka-Plugins:INFO: data-files: Included data file 'lib2to3/PatternGrammar3.9.5.final.0.pickle' due to package data for 'lib2to3.pgen2'.
Nuitka:INFO: Keeping build directory 'test.build'.
Nuitka:INFO: Successfully created 'test.dist/test'.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Use of importlib_metadata breaks jsonschema usage in AWS ...
raises a PackageNotFoundError — importlib_metadata cannot be found, despite it being installed. I have worked around this by simply ...
Read more >Failed to find package metadata for jsonschema
It terminates with this error: importlib_metadata.PackageNotFoundError: No package metadata was found for jsonschema
Read more >importlib_metadata" error in Serverless AWS Lambda
How to fix "PackageNotFoundError: importlib_metadata" error in ... and for one of the endpoints i needed to implement jsonschema validation.
Read more >Using importlib.metadata — Python 3.11.1 documentation
importlib_metadata is a library that provides access to the metadata of an installed Distribution Package, such as its entry points or its top-level...
Read more >问答- 腾讯云开发者社区-腾讯云
它将终止,并显示以下错误: importlib_metadata.PackageNotFoundError: No package metadata was found for jsonschema.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed on github develop, but there will be a hotfix for this soon.
Already releases as part of a hotfix.