Discussion:
Pyinstaller resources.DistributionNotFound 'workalendar'
(too old to reply)
LM FP
2020-05-08 08:37:54 UTC
Permalink
Hi!
I have imported workalendar package -together with others packages- to my python script, and It works fine. I compile it with Pyinstaller without errors, but when I run the exe file appears a warning: pkg_resources.DistributionNotFound: The 'workalendar' distribution was not found and is required by the application.

I execute this: C:\Python\Python38\Scripts\pyinstaller.exe --onefile .\main.spec

And when I execute the exe file returns: pkg_resources.DistributionNotFound: The 'workalendar' distribution was not found and is required by the application
[5716] Failed to execute script main


My spec file:

# -*- mode: python ; coding: utf-8 -*-

block_cipher = None


a = Analysis(['main.py'],
pathex=['C:\\Users\\user\\Downloads\\MyScript',
'C:\\Python\\Python38\\Lib\\site-packages\\workalendar'],
binaries=[],
datas=[],
hiddenimports=['pkg_resources.py2_warn', 'workalendar-9.0.0.dist-info/*', 'workalendar-9.0.0.dist-info'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )

Whats is the problem?
Souvik Dutta
2020-05-08 08:49:44 UTC
Permalink
Have you installed the package listed in the error in a virtual environment?
Post by LM FP
Hi!
I have imported workalendar package -together with others packages- to my
python script, and It works fine. I compile it with Pyinstaller without
pkg_resources.DistributionNotFound: The 'workalendar' distribution was not
found and is required by the application.
I execute this: C:\Python\Python38\Scripts\pyinstaller.exe --onefile .\main.spec
pkg_resources.DistributionNotFound: The 'workalendar' distribution was not
found and is required by the application
[5716] Failed to execute script main
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['main.py'],
pathex=['C:\\Users\\user\\Downloads\\MyScript',
'C:\\Python\\Python38\\Lib\\site-packages\\workalendar'],
binaries=[],
datas=[],
hiddenimports=['pkg_resources.py2_warn',
'workalendar-9.0.0.dist-info/*', 'workalendar-9.0.0.dist-info'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )
Whats is the problem?
--
https://mail.python.org/mailman/listinfo/python-list
LM FP
2020-05-08 09:02:20 UTC
Permalink
Hi, I followed pypi instructions: pip install workalendar, and I also have not installed any virtual python environment on my computer.
Post by Souvik Dutta
Have you installed the package listed in the error in a virtual environment?
Post by LM FP
Hi!
I have imported workalendar package -together with others packages- to my
python script, and It works fine. I compile it with Pyinstaller without
pkg_resources.DistributionNotFound: The 'workalendar' distribution was not
found and is required by the application.
I execute this: C:\Python\Python38\Scripts\pyinstaller.exe --onefile .\main.spec
pkg_resources.DistributionNotFound: The 'workalendar' distribution was not
found and is required by the application
[5716] Failed to execute script main
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['main.py'],
pathex=['C:\\Users\\user\\Downloads\\MyScript',
'C:\\Python\\Python38\\Lib\\site-packages\\workalendar'],
binaries=[],
datas=[],
hiddenimports=['pkg_resources.py2_warn',
'workalendar-9.0.0.dist-info/*', 'workalendar-9.0.0.dist-info'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )
Whats is the problem?
--
https://mail.python.org/mailman/listinfo/python-list
Loading...