Pkg_resource ces.DistributionNotFound:'json架构'

2022-05-08 00:00:00 python python-3.x intel jsonschema

问题描述

无法运行"intel-Nauta",因为它引发了此错误:pkg_resource ces.DistributionNotFound:找不到应用程序所需的‘jsonschema’分发 [19160]无法执行主脚本。

python3.0

在pip安装jsonSCHEMA时,它说已找到要求。 已更改版本仍然存在错误。 已参考以下链接。 https://github.com/IntelAI/nauta/blob/develop/docs/user-guide/actions/getting_started.md

https://github.com/docker/compose/issues/1305

https://github.com/Julian/jsonschema/issues/228

https://github.com/Julian/jsonschema/issues/228

不是一个很棒的程序员,请帮帮忙。 发布整个错误跟踪:

  File "main.py", line 27, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:users****downloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "commandsexperimentexperiment.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "commandsexperimentlist.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "commandsexperimentcommon.py", line 54, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "utiljupyter_notebook_creator.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "libsite-packages
bformat\__init__.py", line 33, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "libsite-packages
bformatvalidator.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "libsite-packagesjsonschema\__init__.py", line 33, in <module>
  File "libsite-packagespkg_resources\__init__.py", line 481, in get_distribution
  File "libsite-packagespkg_resources\__init__.py", line 357, in get_provider
  File "libsite-packagespkg_resources\__init__.py", line 900, in require
  File "libsite-packagespkg_resources\__init__.py", line 786, in resolve
pkg_resources.DistributionNotFound: The 'jsonschema' distribution was not found and is required by the application
[11672] Failed to execute script main

C:UsersxxxxxDownloads
auta
auta-developapplicationsclidist>nctl --help
Traceback (most recent call last):
  File "main.py", line 27, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "commandsexperimentexperiment.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "commandsexperimentlist.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "commandsexperimentcommon.py", line 54, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "utiljupyter_notebook_creator.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "libsite-packages
bformat\__init__.py", line 33, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "libsite-packages
bformatvalidator.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:usersxxxxxdownloads
auta
auta-developapplicationscli.venvlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "libsite-packagesjsonschema\__init__.py", line 33, in <module>
  File "libsite-packagespkg_resources\__init__.py", line 481, in get_distribution
  File "libsite-packagespkg_resources\__init__.py", line 357, in get_provider
  File "libsite-packagespkg_resources\__init__.py", line 900, in require
  File "libsite-packagespkg_resources\__init__.py", line 786, in resolve
pkg_resources.DistributionNotFound: The 'jsonschema' distribution was not found and is required by the application
[19160] Failed to execute script main

解决方案

问题出在PYInstaller不能使用新版本的json架构。在Nautahttps://github.com/IntelAI/nauta/commit/8806aaa87a25d17d89a9aa9062571620d63e2b48中已经有一种解决方法,在该方法中,Requirements s.txt强制jsonschema==2.6.0 请获取最新版本,然后再次尝试内部版本。

相关文章