https://kedro.org/ logo
#questions
Title
# questions
e

Emilio Gagliardi

08/26/2023, 7:05 PM
Hi everyone, has anyone tried getting jupyter_ai package working? I tried updating the jupyterlab to 4.0 in my kedro project and then install jupyter_ai but it doesn't work. The documentation for jupyter_ai only mentions python3.11 but I don't think kedro works with python 3.11 so I have 3.10.12. If anyone has any tips I'd love to hear them! https://jupyter-ai.readthedocs.io/en/latest/users/index.html#prerequisites
d

Deepyaman Datta

08/27/2023, 3:32 AM
Jupiter AI supports Python 3.8-3.11; this is stated in the link you share, their GitHub, and the package pyproject.toml.
j

Juan Luis

08/28/2023, 7:29 AM
hi @Emilio Gagliardi ! the docs indeed showcase Python 3.11, but as @Deepyaman Datta says, older versions are fine too, for example 3.10 (notice by the way that Kedro will officially support 3.11 this week 🥁 ) when you say it didn’t work, you mean the installation failed for some reason, or you already tried the %ai command and nothing happened?
e

Emilio Gagliardi

08/28/2023, 6:13 PM
I don't understand your point @Deepyaman Datta. I understood that. My kedro project runs python 3.10. @Juan Luis I installed all the requirements (I thought) and when the lab page loaded, the plugin didn't load and it said look at the output in the terminal for error messages but there wasn't anything there.
j

Juan Luis

08/28/2023, 6:16 PM
I see @Emilio Gagliardi, can you double check the Jupyter version? I suspect Kedro is downgrading it but want to be sure
e

Emilio Gagliardi

08/28/2023, 6:17 PM
this is all it says after I install the plugin: There seems to be a problem with the Chat backend, please look at the JupyterLab server logs or contact your administrator to correct this problem. Version is: Version 4.0.5
j

Juan Luis

08/28/2023, 6:18 PM
the "JupyterLab server logs" should be in the terminal where you launched
jupyter lab
, do you spot anything fishy there? some red text or Python traceback
e

Emilio Gagliardi

08/28/2023, 6:19 PM
all it says is: [W 2023-08-28 181731.355 ServerApp] 404 GET /api/ai/chats?token=[secret] (f8e3e47481954f3c8e62e3fce9814743@::1) 2.00ms referer=None
OK, I figured it out. even if you're not going to use OpenAI you have to set the environment key in the terminal before you launch jupyter lab. It isn't clear that's a required step in the instructions. I wasn't clear how to set environment variables but once I "set OPENAI_API_KEY=" and then ran jupyter lab, the plugin loaded correctly.
j

Juan Luis

08/28/2023, 6:32 PM
glad you solved it!
it's not a very informative error message indeed
e

Emilio Gagliardi

08/28/2023, 6:32 PM
thanks for checking in @Juan Luis and @Deepyaman Datta!
🙌🏼 1