heedy / heedy-notebook-plugin

Use Jupyter notebooks in Heedy
Other
2 stars 0 forks source link

h is missing #8

Open robbieh opened 8 months ago

robbieh commented 8 months ago

I installed the latest notebook plugin. After creating a new notebook and running h.objects() I get this:



NameError Traceback (most recent call last) Cell In[13], line 1 ----> 1 h.objects()

NameError: name 'h' is not defined

General python commands work. I can see a heedy module looking through the globals. I'm at a loss for what to do next.

dkumor commented 8 months ago

That’s weird, this is the code that is run when the notebook starts: https://github.com/heedy/heedy-notebook-plugin/blob/master/backend/notebook_header.py

can you try pasting that into a cell and checking if it gives an error?

robbieh commented 8 months ago

That partly fixes it! Setting h to heedy.app helped. Looks like it's failing to find seaborn:

FileNotFoundError: [Errno 2] No such file or directory: 'seaborn'

If I take the relevant lines out, the rest works.

dkumor commented 8 months ago

Try running: %pip install seaborn

that might fix the issue

robbieh commented 8 months ago

Looks to already be there:

Requirement already satisfied: seaborn in /data/venv/notebook/lib/python3.10/site-packages (0.13.2)
Requirement already satisfied: pandas>=1.2 in /data/venv/notebook/lib/python3.10/site-packages (from seaborn) (2.2.0)
Requirement already satisfied: matplotlib!=3.6.1,>=3.4 in /data/venv/notebook/lib/python3.10/site-packages (from seaborn) (3.8.2)
Requirement already satisfied: numpy!=1.24.0,>=1.20 in /data/venv/notebook/lib/python3.10/site-packages (from seaborn) (1.26.3)
Requirement already satisfied: cycler>=0.10 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (0.12.1)
Requirement already satisfied: pyparsing>=2.3.1 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (3.1.1)
Requirement already satisfied: contourpy>=1.0.1 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (1.2.0)
Requirement already satisfied: python-dateutil>=2.7 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (2.8.2)
Requirement already satisfied: kiwisolver>=1.3.1 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (1.4.5)
Requirement already satisfied: fonttools>=4.22.0 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (4.47.2)
Requirement already satisfied: packaging>=20.0 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (23.2)
Requirement already satisfied: pillow>=8 in /data/venv/notebook/lib/python3.10/site-packages (from matplotlib!=3.6.1,>=3.4->seaborn) (10.2.0)
Requirement already satisfied: pytz>=2020.1 in /data/venv/notebook/lib/python3.10/site-packages (from pandas>=1.2->seaborn) (2024.1)
Requirement already satisfied: tzdata>=2022.7 in /data/venv/notebook/lib/python3.10/site-packages (from pandas>=1.2->seaborn) (2023.4)
Requirement already satisfied: six>=1.5 in /data/venv/notebook/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib!=3.6.1,>=3.4->seaborn) (1.16.0)
robbieh commented 8 months ago

Might be this: https://zhauniarovich.com/post/2022/2022-12-styling-matplotlib-graphs-with-seaborn/

This is from the install log, and it looks like matplotlib-3.8.2 is installed:

Installing collected packages: rpds-py, attrs, six, referencing, types-python-dateutil, traitlets, python-dateutil, platformdirs, jsonschema-specifications, tornado, pyzmq, pycparser, jupyter-core, jsonschema, fastjsonschema, arrow, webencodings, webcolors, uri-template, soupsieve, rfc3986-validator, rfc3339-validator, ptyprocess, nbformat, MarkupSafe, jupyter-client, jsonpointer, isoduration, idna, fqdn, cffi, wcwidth, typing-extensions, tinycss2, terminado, sniffio, pyyaml, python-json-logger, pygments, pure-eval, parso, pandocfilters, packaging, nbclient, mistune, jupyterlab-pygments, jinja2, executing, exceptiongroup, defusedxml, bleach, beautifulsoup4, asttokens, argon2-cffi-bindings, websocket-client, urllib3, stack-data, send2trash, prompt-toolkit, prometheus-client, pexpect, overrides, nbconvert, matplotlib-inline, jupyter-server-terminals, jupyter-events, jedi, h11, decorator, charset-normalizer, certifi, argon2-cffi, anyio, requests, psutil, nest-asyncio, jupyter-server, json5, ipython, httpcore, debugpy, comm, babel, tomli, numpy, notebook-shim, multidict, jupyterlab-server, jupyter-lsp, ipykernel, httpx, frozenlist, async-lru, yarl, widgetsnbextension, tzlocal, tzdata, regex, qtpy, pytz, pyparsing, pillow, kiwisolver, jupyterlab-widgets, jupyterlab, fonttools, cycler, contourpy, async-timeout, aiosignal, qtconsole, pandas, notebook, matplotlib, jupyter-console, ipywidgets, dateparser, aiohttp, wheel, seaborn, jupyter, heedy, aiosqlite
heedy       | Successfully installed MarkupSafe-2.1.5 aiohttp-3.9.3 aiosignal-1.3.1 aiosqlite-0.19.0 anyio-4.2.0 argon2-cffi-23.1.0 argon2-cffi-bindings-21.2.0 arrow-1.3.0 asttokens-2.4.1 async-lru-2.0.4 async-timeout-4.0.3 attrs-23.2.0 babel-2.14.0 beautifulsoup4-4.12.3 bleach-6.1.0 certifi-2024.2.2 cffi-1.16.0 charset-normalizer-3.3.2 comm-0.2.1 contourpy-1.2.0 cycler-0.12.1 dateparser-1.2.0 debugpy-1.8.0 decorator-5.1.1 defusedxml-0.7.1 exceptiongroup-1.2.0 executing-2.0.1 fastjsonschema-2.19.1 fonttools-4.47.2 fqdn-1.5.1 frozenlist-1.4.1 h11-0.14.0 heedy-0.2.0 httpcore-1.0.2 httpx-0.26.0 idna-3.6 ipykernel-6.29.0 ipython-8.21.0 ipywidgets-8.1.1 isoduration-20.11.0 jedi-0.19.1 jinja2-3.1.3 json5-0.9.14 jsonpointer-2.4 jsonschema-4.21.1 jsonschema-specifications-2023.12.1 jupyter-1.0.0 jupyter-client-8.6.0 jupyter-console-6.6.3 jupyter-core-5.7.1 jupyter-events-0.9.0 jupyter-lsp-2.2.2 jupyter-server-2.12.5 jupyter-server-terminals-0.5.2 jupyterlab-4.1.0 jupyterlab-pygments-0.3.0 jupyterlab-server-2.25.2 jupyterlab-widgets-3.0.9 kiwisolver-1.4.5 matplotlib-3.8.2 matplotlib-inline-0.1.6 mistune-3.0.2 multidict-6.0.5 nbclient-0.9.0 nbconvert-7.14.2 nbformat-5.9.2 nest-asyncio-1.6.0 notebook-7.0.7 notebook-shim-0.2.3 numpy-1.26.3 overrides-7.7.0 packaging-23.2 pandas-2.2.0 pandocfilters-1.5.1 parso-0.8.3 pexpect-4.9.0 pillow-10.2.0 platformdirs-4.2.0 prometheus-client-0.19.0 prompt-toolkit-3.0.43 psutil-5.9.8 ptyprocess-0.7.0 pure-eval-0.2.2 pycparser-2.21 pygments-2.17.2 pyparsing-3.1.1 python-dateutil-2.8.2 python-json-logger-2.0.7 pytz-2024.1 pyyaml-6.0.1 pyzmq-25.1.2 qtconsole-5.5.1 qtpy-2.4.1 referencing-0.33.0 regex-2023.12.25 requests-2.31.0 rfc3339-validator-0.1.4 rfc3986-validator-0.1.1 rpds-py-0.17.1 seaborn-0.13.2 send2trash-1.8.2 six-1.16.0 sniffio-1.3.0 soupsieve-2.5 stack-data-0.6.3 terminado-0.18.0 tinycss2-1.2.1 tomli-2.0.1 tornado-6.4 traitlets-5.14.1 types-python-dateutil-2.8.19.20240106 typing-extensions-4.9.0 tzdata-2023.4 tzlocal-5.2 uri-template-1.3.0 urllib3-2.2.0 wcwidth-0.2.13 webcolors-1.13 webencodings-0.5.1 websocket-client-1.7.0 wheel-0.42.0 widgetsnbextension-4.0.9 yarl-1.9.4
dkumor commented 8 months ago

I see, so it looks like the fix is to delete line 15 of https://github.com/heedy/heedy-notebook-plugin/blob/master/backend/notebook_header.py