Given an entry file main.py like so:
#-*- coding: utf-8 -*-
# -*- mode: python -*-
import hy
import os.path
import hymodule
datas=[(os.path.dirname(hy.__file__), 'hy')]
hymodule.hello_world()
Given a Hy file hymodule.hy:
(defn hello-world []
(print "hello world!"))
If I use pyinstaller to create a standalone file:
pyinstaller main.py --onefile
And execute main.exe I get this error:
$ ./dist/main.exe
Traceback (most recent call last):
File "main.py", line 6, in <module>
import hymodule
ModuleNotFoundError: No module named 'hymodule'
[10852] Failed to execute script main
- Everything works fine if I execute main.py using python (without using pyinstaller).
- Everything works fine if I change hymodule to be a Python module and use pyinstaller
What is the proper way to create a standalone executable using Hy modules?