jupyter-ai
jupyter-ai copied to clipboard
Contributor installation doesn't work on Windows
Description
Hi all,
I'm a developer who is considering to contribute to jupyter-ai. I work on Windows though. The development installation instructions for contributors mentions this terminal command:
# Move to the root of the repo package
cd <jupyter-ai-top>
# Installs all the dependencies and sets up the dev environment
./scripts/install.sh
Which obviously won't work on Windows. Modifying the install.sh to an install.bat seems trivial, but there is an error when executing call jlpm install
Reproduce
Start up windows, install mamba, setup an environment install jupyter-ai as explained in the docs:
- Setup environment:
conda create -n jupyter-ai python=3.11
- Activate environment:
conda activate jupyter-ai
From the jupyter-ai code directory (version https://github.com/jupyterlab/jupyter-ai/commit/f9c8033d79c5e20fe7d00284f2d2ddb58db94406 ) run this:
scripts\install.bat
using this modified scripts/install.bat
call pip install jupyterlab~=4.0
copy playground/config.example.py playground/config.py
call jlpm install
call jlpm dev-install
call pip install sphinx
call pip install -r docs/requirements.txt
This error shows in the error log:
(jupyter-ai) C:\structure\code\jupyter-ai>call jlpm install
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\rober\miniconda3\envs\jupyter-ai\Scripts\jlpm.exe\__main__.py", line 7, in <module>
File "C:\Users\rober\miniconda3\envs\jupyter-ai\Lib\site-packages\jupyterlab\jlpmapp.py", line 43, in main
execvp("node", ["node", YARN_PATH, *argv])
File "C:\Users\rober\miniconda3\envs\jupyter-ai\Lib\site-packages\jupyterlab\jlpmapp.py", line 24, in execvp
cmd = which(cmd)
^^^^^^^^^^
File "C:\Users\rober\miniconda3\envs\jupyter-ai\Lib\site-packages\jupyterlab_server\process.py", line 61, in which
raise ValueError(msg)
ValueError: Please install Node.js and npm before continuing installation. You may be able to install Node.js from your package manager, from conda, or directly from the Node.js website (https://nodejs.org).
Complete log: error_log.txt
I presume I need to install something else before?
Expected behavior
The installation runs through successfully.
Context
- Operating System and version: Windows 10
- Browser and version: Chrome 120
- JupyterLab version: 4.0.10
Two things I can offer:
- I can send my modified scripts/install.bat as PR.
- I can debug the error above and send a PR.
Just let me know if you're interested in having developer instructions / scripts for Windows folks.
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
@haesleinhuepf Thanks for opening this issue! Our install.sh script is intended to be run with Bash, which you can get using the Windows Subsystem for Linux (WSL): https://www.howtogeek.com/790062/how-to-install-bash-on-windows-11/ (these instructions are for Windows 11, but WSL is also available for Windows 10)
Please let us know if the Bash script works in WSL. We would also be open to a PR with a working install.bat file, preferably if we could automatically update one of the files when the other changes.