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

pkg_resources.DistributionNotFound: The 'django-babel' distribution was not found and is required by the application #4281

Open
eshopblr opened this issue Jun 21, 2019 · 2 comments

Comments

@eshopblr
Copy link

@eshopblr eshopblr commented Jun 21, 2019

I'm generating a django project exe and in it's setting a package of "django_babel" and sucessfully able to generate exe but when executing the exe i'm getting following error.

Perhaps I have included the "import djang_babel" in manage.py but error remain same.
I'm using latest Pyinstaller and Django2.0.

(django1point8Env) C:\pythonWebCode\django-custom-user-model\exe>dist\django-custom-user-model\django-custom-user-model.exe runsslserver

c:\pythonwebcode\django-custom-user-model\exe\manage.py(14)()
(Pdb) c
Traceback (most recent call last):
File "manage.py", line 14, in
File "", line 971, in find_and_load
File "", line 955, in find_and_load_unlocked
File "", line 665, in load_unlocked
File "c:\pythonwebcode\django1point8env\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.dict)
File "lib\site-packages\django_babel_init
.py", line 4, in
File "lib\site-packages\pkg_resources_init
.py", line 472, in get_distribution
File "lib\site-packages\pkg_resources_init.py", line 344, in get_provider
File "lib\site-packages\pkg_resources_init_.py", line 892, in require
File "lib\site-packages\pkg_resources_init_.py", line 778, in resolve
pkg_resources.DistributionNotFound: The 'django-babel' distribution was not found and is required by the application
[17608] Failed to execute script manage

@eshopblr

This comment has been minimized.

Copy link
Author

@eshopblr eshopblr commented Jun 22, 2019

I tried just for simple test.py as follows and not a django project and still it gives same error.

test.py

import importlib
import django_babel
import datetime

if name == 'main':

print("Hello dear friend, how are you")
today = datetime.date.today()  
print(today)

generated exe as follows

pyinstaller test.py

executed exe and getting the same error

(django1point8Env) C:\pythonWebCode\test>dist\test\test.exe
Traceback (most recent call last):
File "test.py", line 2, in
import django_babel
File "", line 971, in find_and_load
File "", line 955, in find_and_load_unlocked
File "", line 665, in load_unlocked
File "c:\pythonwebcode\django1point8env\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.dict)
File "lib\site-packages\django_babel_init
.py", line 4, in
File "lib\site-packages\pkg_resources_init
.py", line 472, in get_distribution
File "lib\site-packages\pkg_resources_init.py", line 344, in get_provider
File "lib\site-packages\pkg_resources_init_.py", line 892, in require
File "lib\site-packages\pkg_resources_init_.py", line 778, in resolve
pkg_resources.DistributionNotFound: The 'django-babel' distribution was not found and is required by the application
[17452] Failed to execute script test

@htgoebel

This comment has been minimized.

Copy link
Member

@htgoebel htgoebel commented Aug 7, 2019

I assume a hook is needed for django-babel to include the meta-data.
We would appreciate if you'd submit a pull-request for a hook for this. See this section of the manual for more information about how to implement hooks and otehr hooks for how to include the meta-data. See our Development Guide on how to create pull-requests for PyInstaller. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.