Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pyinstaller on ubuntu throws exception PyInstaller.compat.FileNotFoundError

Tags:

pyinstaller

Running

pyinstaller myfile.spec

Tracebacok below

Traceback (most recent call last):
  File "/usr/local/bin/pyinstaller", line 9, in <module>
    load_entry_point('PyInstaller==3.0', 'console_scripts', 'pyinstaller')()
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/__main__.py", line 99, in run
    run_build(opts, spec_file, pyi_config)
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/__main__.py", line 47, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **opts.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/build_main.py", line 737, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/build_main.py", line 680, in build
    exec(text, spec_namespace)
  File "<string>", line 6, in <module>
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/build_main.py", line 207, in __init__
    self.__postinit__()
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/datastruct.py", line 156, in __postinit__
    self.assemble()
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/build_main.py", line 430, in assemble
    imphook_object.update_dependencies(self.graph)
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/imphook.py", line 345, in update_dependencies
    self._process_datas(mod_graph)
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/imphook.py", line 313, in _process_datas
    self.datas.update(set(format_binaries_and_datas(self._module.datas)))
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/building/utils.py", line 422, in format_binaries_and_datas
    src_root_path_or_glob))
PyInstaller.compat.FileNotFoundError: Path or glob "/usr/include/python2.7/pyconfig.h" not found or matches no files.
like image 487
Jonathan Avatar asked Feb 09 '23 17:02

Jonathan


1 Answers

Pyinstaller needs an Ubuntu package, because it has several dependencies. This is not documented, but you need python-dev:

apt install build-essential python-dev
like image 124
Jonathan Avatar answered Apr 27 '23 04:04

Jonathan