How to fix error when using pyinstaller for creating exe file using LaZagne tool in kali linux

root@kali:/opt/LaZagne/Linux# pyinstaller --onefile -w

29 INFO: PyInstaller: 3.6
29 INFO: Python: 2.7.18
29 INFO: Platform: Linux-6.3.0-kali1-amd64-x86_64-with-debian-kali-rolling
30 INFO: wrote /opt/LaZagne/Linux/laZagne.spec
35 INFO: UPX is available.
37 INFO: Extending PYTHONPATH with paths
[‘/opt/LaZagne/Linux’, ‘/opt/LaZagne/Linux’]
37 INFO: checking Analysis
38 INFO: Building Analysis because Analysis-00.toc is non existent
38 INFO: Initializing module dependency graph…
40 INFO: Caching module graph hooks…
48 INFO: Caching module dependency graph…
61 INFO: running Analysis Analysis-00.toc
174 INFO: Analyzing /opt/LaZagne/Linux/
2070 INFO: Processing pre-safe import module hook _xmlplus
2199 INFO: Processing module hooks…
2200 INFO: Loading module hook “”…
2715 INFO: Loading module hook “”…
2716 INFO: Loading module hook “”…
3403 INFO: Looking for ctypes DLLs
3418 INFO: Analyzing run-time hooks …
3424 INFO: Looking for dynamic libraries
4068 INFO: Looking for eggs
4069 INFO: Python library not in binary dependencies. Doing additional searching…
Traceback (most recent call last):
File “/usr/local/bin/pyinstaller”, line 8, in
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/”, line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/”, line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/building/”, line 734, in main
build(specfile, kw.get(‘distpath’), kw.get(‘workpath’), kw.get(‘clean_build’))
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/building/”, line 681, in build
exec(code, spec_namespace)
File “/opt/LaZagne/Linux/laZagne.spec”, line 17, in
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/building/”, line 244, in init
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/building/”, line 160, in postinit
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/building/”, line 478, in assemble
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/building/”, line 568, in _check_python_library
python_lib = bindepend.get_python_library_path()
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/depend/”, line 915, in get_python_library_path
python_libname = findLibrary(name)
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/depend/”, line 775, in findLibrary
File “/usr/local/lib/python2.7/dist-packages/PyInstaller/depend/”, line 400, in load_ldconfig_cache
path = m.groups()[-1]
AttributeError: ‘NoneType’ object has no attribute ‘groups’

So I Reinstall pyinstaller but nothing happened

Can you please try using python3 instead of python2?