BEEmod/BEE2.4

Problem building BEE2.spec on linux at "Loading module hook 'hook-_tkinter.py"

Closed this issue · 2 comments

BEE2 Application Version

Both the master and dev branches have the same issue.

BEE2 Package Version

N/A

What operating system are you running on?

Linux

Description of the bug

Trying to build for linux according to the instructions on the wiki, on either the master or the dev branch, does not work, specifically BEE2.spec.

Expected behavior

Well, I'd have expected the build to work.

Steps to reproduce

Step 1 - Try to run pyinstaller --distpath ../dist/64bit/ --workpath ../build_tmp BEE2.spec
Step 2 - It errors out

Logs and Reports

11866 INFO: Loading module hook 'hook-_tkinter.py' from '/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/hooks'...
Traceback (most recent call last):
  File "/home/linuxcat/tempvenv/bin/pyinstaller", line 8, in <module>
    sys.exit(_console_script_run())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/__main__.py", line 231, in _console_script_run
    run()
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/__main__.py", line 215, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/__main__.py", line 70, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/building/build_main.py", line 1216, in main
    build(specfile, distpath, workpath, clean_build)
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/building/build_main.py", line 1156, in build
    exec(code, spec_namespace)
  File "BEE2.spec", line 308, in <module>
    bee2_a = Analysis(
             ^^^^^^^^^
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/building/build_main.py", line 556, in __init__
    self.__postinit__()
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/building/datastruct.py", line 184, in __postinit__
    self.assemble()
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/building/build_main.py", line 702, in assemble
    self.graph.process_post_graph_hooks(self)
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/depend/analysis.py", line 329, in process_post_graph_hooks
    module_hook.post_graph(analysis)
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/depend/imphook.py", line 447, in post_graph
    self._process_hook_func(analysis)
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/depend/imphook.py", line 469, in _process_hook_func
    self._hook_module.hook(hook_api)
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/hooks/hook-_tkinter.py", line 27, in hook
    hook_api.add_datas(collect_tcl_tk_files(hook_api.__file__))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/utils/hooks/tcl_tk.py", line 236, in collect_tcl_tk_files
    tcl_root, tk_root = _find_tcl_tk(tkinter_ext_file)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/linuxcat/tempvenv/lib/python3.12/site-packages/PyInstaller/utils/hooks/tcl_tk.py", line 198, in _find_tcl_tk
    tk_dir = os.path.join(os.path.dirname(tcl_dir), f"tk{tk_version}")
                          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 181, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

Additional information

I'm using Python 3.12, I followed the wiki and ran this in a venv.

That suggests you don't have tkinter installed, that's separated out on Linux since you don't need UI in like server.

That suggests you don't have tkinter installed, that's separated out on Linux since you don't need UI in like server.

Indeed, thanks - I thought it'd be installed as part of requirements.txt. It should probably be mentioned in the wiki that tkinter is separate then, and can be installed with pacman -S tk or similar.