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 'PyInstaller'... #5275
Comments
You're getting the error because you are trying to import PyInstaller in your program. This block from PyInstaller.utils.hooks import collect_data_files
datas += collect_data_files('branca', subdir='templates')
datas += collect_data_files('folium', subdir='templates') should be placed into your .spec file, not the program (.py) file. |
Are you sure this Linux solution works? my code
my spec
pyinstaller -F --clean program.spec after running the executable: @Phoenix009 |
You need to collect all from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('branca')
datas += collect_data_files('folium', subdir='templates') |
Good. |
OS: Linux
pyinstaller: v4.0
environment: pipenv
python: v3.7
I would like to put together a simple code using the 'Folium' library
simple code
program.py
pyinstaller -F --clean program.py
OK
when I try to run the executable I get the error:
_Traceback (most recent call last):
File "program.py", line 1, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in load_unlocked
File "/home/salim/.local/share/virtualenvs/folium-7tyjei-/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.dict)
File "PyInstaller/init.py", line 55, in
File "pkg_resources/init.py", line 465, in get_distribution
File "pkg_resources/init.py", line 341, in get_provider
File "pkg_resources/init.py", line 884, in require
File "pkg_resources/init.py", line 770, in resolve
pkg_resources.DistributionNotFound: The 'PyInstaller' distribution was not found and is required by the application
[15296] Failed to execute script 1
I tried to solve the problem as stated here:
#5256
#5262
I opened the file:
site-packages/branca/element.py
Replaced the line:
ENV = Environment(loader=PackageLoader('branca', 'templates'))
to
and
site-packages/folium/raster_layers.py
ENV = Environment(loader=PackageLoader('folium', 'templates'))
to
No effect the same error. Is there any way to solve the problem?
The text was updated successfully, but these errors were encountered: