Do you have a more exact version spec? Because I don’t even have pip3 and I don’t use Python, so I just installed the hy that comes with my distro… and then I get
File "./main.hy", line 63, column 1
(defn initial-population [biome]
"Creates a list of initial organisms"
(+ [] #*
(lfor species +species-list+
(if (= (. species ["spawning-zone"])
biome)
(do
(setv organisms [])
(setv energy +seed-population-energy+)
(while (> energy 0)
(.append organisms (.copy species))
(-= energy (energy-of species)))
organisms)
[]))))
HyTypeError: b"`*' is not a defined reader macro."
and I don’t even have a clue what the b"``*' part is supposed to mean...
I experimented some more, no clue what package I’d have to install to get pip - neither pip nor pip3 exist. On the systems that I have, I get matplotlib 3.0.2-2 with hy 0.12.1-2.
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.)
Do you have a more exact version spec? Because I don’t even have
pip3
and I don’t use Python, so I just installed thehy
that comes with my distro… and then I getand I don’t even have a clue what the
b"``*'
part is supposed to mean...I experimented some more, no clue what package I’d have to install to get
pip
- neitherpip
norpip3
exist. On the systems that I have, I get matplotlib 3.0.2-2 with hy 0.12.1-2.On Ubuntu, at least, there’s a
python3-pip
package, separately from thepython3
package? (Other distros may be similar.) It’s also supposed to be possible to installpip
using Python 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.)