Skip to content

get_distribution assertion when used in application packaged with pyinstaller #534

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
cc10512 opened this issue Mar 2, 2019 · 1 comment
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup

Comments

@cc10512
Copy link

cc10512 commented Mar 2, 2019

The commit b07d0f1 added retrieving the version using pkg_resources.get_distribution. This seems to break the initialization when the jsonschema module is included in a pyinstaller (http://www.pyinstaller.org/) generated executable. An example trace is below. Note that the same script works fine when it is not packaged with pyinstaller. Our current solution was to go back to jsonschema 2.6.0 which works in both scenarios. Please let us know if there is any hidden module that should be added to the pyinstaller setup, or any other method to register jsonschema with pkg_resources.

Traceback (most recent call last):
  File "build-json-logs", line 36, in <module>
  File "/tmp/pip-build-A5sYoJ/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "tools/create_json.py", line 24, in <module>
  File "/tmp/pip-build-A5sYoJ/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "jsonschema/__init__.py", line 33, in <module>
  File "pkg_resources/__init__.py", line 476, in get_distribution
  File "pkg_resources/__init__.py", line 352, in get_provider
  File "pkg_resources/__init__.py", line 895, in require
  File "pkg_resources/__init__.py", line 781, in resolve
pkg_resources.DistributionNotFound: The 'jsonschema' distribution was not found and is required by the application
@Julian
Copy link
Member

Julian commented Mar 2, 2019

Hi, sorry you're having trouble.

Please see #530 (comment).

@Julian Julian closed this as completed Mar 2, 2019
@Julian Julian added the Invalid Not a bug, PEBKAC, or an unsupported setup label Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup
Projects
None yet
Development

No branches or pull requests

2 participants