I have written a small python script to understand how to build an executable using pyinstaller. the script is
import numpy
import scipy
from scipy.optimize import linear_sum_assignment
from scipy.spatial.distance import cosine
from scipy.sparse.csgraph import _validation
value_cos = cosine(0.2, 0.8) * 0.5
print('\n cos value calculated using cosine', value_cos)
cost = numpy.array([[4, 1, 3], [2, 0, 5], [3, 2, 2]])
ls_assign = linear_sum_assignment(cost)
print("\n ls_assignment value :", ls_assign)
I do not see any error when I build the executable but when I go to the dist directory and try to run the executable, I get the following error
Traceback (most recent call last):
File "site-packages/PyInstaller/loader/rthooks/pyi_rth_pkgres.py", line 13, in <module>
File "/home/puneet/miniconda3/envs/nuitka/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages/pkg_resources/__init__.py", line 85, in <module>
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'
[210875] Failed to execute script pyi_rth_pkgres
I am not sure if I am missing any arguments while building the executable. Any help will be appreciated.