automate/020_jupyter.sh

28 lines
804 B
Bash

#!/usr/bin/env bash
#
# sudo apt-get install jupyter-notebook
JUPYTER_HOME=/space/code_repositories/jupyter
NEW_CENV=jupyter-ai
PYTHON_VERSION=3.11
# Install jupyter-ai in a conda environment with conda and pip
# https://github.com/jupyterlab/jupyter-ai
# https://jupyter-ai.readthedocs.io/en/latest/users/index.html#installation
mkdir -p ${JUPYTER_HOME}/${NEW_CENV}
cd ${JUPYTER_HOME}/${NEW_CENV} || exit
conda create -n ${NEW_CENV} python=${PYTHON_VERSION}
conda activate ${NEW_CENV}
conda install -c conda-forge jupyter-ai
# Install pydantic langchain says its is compatible with 1 & 2
# but complains missing v1
# The module 'jupyter_ai' could not be found
# (No module named 'langchain.pydantic_v1')
pip install pydantic==1.*
echo "cd to ${JUPYTER_HOME}/${NEW_CENV} and run 'jupyter lab'"