0

I have run an intro to Hy session for the Atlanta Functional Programming meetup.

One audience for this intro is Pythonistas that might want to use Hy to get acquainted with a Lispy syntax by porting their python projects to Hy.

Since Jupyter is popular with Pythonistas (I use it a lot to do exploratory coding when I write Python), I'd like to use Calysto Hy kernel.

When I select the Calysto Hy tile in Jupyter lab, in the terminal from which I launched Jupyter, I see the following message repeating a lot, and code is not executed in Jupyter:

[I 20:36:29.895 LabApp] Kernel started: cb8848bf-491e-4502-96fa-8089b8aca66d
Traceback (most recent call last):
  File "/home/gt/anaconda3/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/gt/anaconda3/lib/python3.7/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/home/gt/anaconda3/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/gt/anaconda3/lib/python3.7/site-packages/calysto_hy/__init__.py", line 2, in <module>
    from .kernel import CalystoHy
  File "/home/gt/anaconda3/lib/python3.7/site-packages/calysto_hy/kernel.py", line 13, in <module>
    from hy.macros import _hy_macros, load_macros
ImportError: cannot import name '_hy_macros' from 'hy.macros' (/home/gt/anaconda3/lib/python3.7/site-packages/hy/macros.py)

When I open /home/gt/anaconda3/lib/python3.7/site-packages/hy/macros.py in trusty ol' emacs, I see nothing named _hy_macros.

I'd appreciate any help I can get in getting calysto Hy to work.

I have another teaching session coming up in a couple of weeks.

dagmarPrime
  • 317
  • 3
  • 9
  • Make sure that you're using compatible versions of Jupyter, Calysto, Hy, and Python. If you are, it's probably a Calysto bug. – Kodiologist Nov 13 '20 at 19:31
  • That certainly makes sense. Is there authoritative info about fruitful combinations? – dagmarPrime Nov 14 '20 at 00:16
  • -- I'll edit this comment in a bit --- – dagmarPrime Nov 14 '20 at 00:23
  • OK. I am using `Calysto-Hy 0.1.1`, `Hy 0.19.0`, and `jupyter core : 4.6.3` `jupyter-notebook : 6.0.3` `qtconsole : 4.7.0` `ipython : 7.13.0` `ipykernel : 5.1.4` `jupyter client : 6.0.0` `jupyter lab : 2.0.0` `nbconvert : 5.6.1` `ipywidgets : 7.5.1` `nbformat : 5.0.4` `traitlets : 4.3.3` @Kodiologist – dagmarPrime Nov 14 '20 at 00:35
  • I don't know what a good combination of versions is because I've never used Jupyter. – Kodiologist Nov 14 '20 at 14:03
  • Thanks for responding. Do you use other such notebooks? I appreciate your time. @kodiologist – dagmarPrime Nov 14 '20 at 17:10
  • I just use Org-mode. – Kodiologist Nov 15 '20 at 20:13
  • OK. I used org mode for a presentation I recently did for Atlanta Functional Programming meetup. I know a lot of students of the DS track at Lambda School, and they use the python ecosystem. Mark Watson wrote a book on his use of Hy to carry out DS work. Hey, do you have an example of a good use of defmacro in Hy? – dagmarPrime Nov 15 '20 at 21:49
  • https://docs.hylang.org/en/stable/whyhy.html#do-while – Kodiologist Nov 16 '20 at 14:08

0 Answers0