Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hy
>>> import main
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/hy/macros.py", line 238, in reader_macroexpand
reader_macro = _hy_reader[None][char]
KeyError: '*'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
File "/usr/lib/python3/dist-packages/hy/importer.py", line 197, in load_module
self.path)
[...(*snip*)...]
File "/usr/lib/python3/dist-packages/hy/compiler.py", line 424, in compile_atom
ret = _compile_table[atom_type](self, atom)
File "/usr/lib/python3/dist-packages/hy/compiler.py", line 365, in checker
return fn(self, expression)
File "/usr/lib/python3/dist-packages/hy/compiler.py", line 2559, in compile_dispatch_reader_macro
expr = reader_macroexpand(str_char, expression.pop(0), self)
File "/usr/lib/python3/dist-packages/hy/macros.py", line 242, in reader_macroexpand
"`{0}' is not a defined reader macro.".format(char)
hy.errors.HyTypeError: File "/home/nobody/projects/darwin/main.hy", line 63, column 1
[and then as before]
Guess I’ll try setting things up on another system tomorrow, or else I’ll skip.
The import main workaround did solve the error for someone else. In case it helps, I’m using Python 3.8.10 with the following two libraries installed via pip3.
Turns out it needs a newer hy, then it works. (And in case anyone else has a similar problem and is also a Python noob, pip’s package is probably called python3-pip or something like that. After that, the rest is explained either in the article or by pip itself.)
Here is a workaround.
cd
into the project directoryRun the python3 interpreter
In the python3 interpretor, call
import hy
In the python3 interpretor, call
import main
That just gets me an even longer error message:
Guess I’ll try setting things up on another system tomorrow, or else I’ll skip.
The
import main
workaround did solve the error for someone else. In case it helps, I’m using Python 3.8.10 with the following two libraries installed via pip3.Thanks!
Turns out it needs a newer
hy
, then it works. (And in case anyone else has a similar problem and is also a Python noob,pip
’s package is probably calledpython3-pip
or something like that. After that, the rest is explained either in the article or bypip
itself.)