Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix erroneous instructions to setup a devel environment #64

Open
parmentelat opened this issue Dec 19, 2023 · 3 comments
Open

fix erroneous instructions to setup a devel environment #64

parmentelat opened this issue Dec 19, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@parmentelat
Copy link

followed the Contributing section of README.md but ran into the following error

 git (master >) $ git clone git@github.com:jupyterlab-contrib/rise.git
Cloning into 'rise'...
remote: Enumerating objects: 601, done.
remote: Counting objects: 100% (262/262), done.
remote: Compressing objects: 100% (151/151), done.
remote: Total 601 (delta 148), reused 193 (delta 101), pack-reused 339
Receiving objects: 100% (601/601), 15.16 MiB | 8.72 MiB/s, done.
Resolving deltas: 100% (273/273), done.

 git (master >) $ cd rise

 rise (main =) $ conda create -n rise python=3.11 node=20.5
Collecting package metadata (current_repodata.json): done
Solving environment: done
<snip>

 rise (main =) $ conda activate rise

[rise] rise (main =) $ pip install -e ".[test]"
Obtaining file:///Users/tparment/git/rise
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... done
<snip>

[rise] rise (main =) $ jupyter labextension develop . --overwrite
usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]
<snip>
Available subcommands: config dejavu events execute kernel kernelspec migrate nbconvert run server troubleshoot trust
Jupyter command `jupyter-labextension` not found.

[rise] rise (main =) $ pip install jupyter
Collecting jupyter
<snip>

[rise] rise (main =) $ jupyter labextension develop . --overwrite
Installing /Users/tparment/git/rise/jupyterlab_rise/labextension -> jupyterlab-rise
Building extension in /Users/tparment/git/rise/jupyterlab_rise
/Users/tparment/miniconda3/envs/rise/lib/python3.11/site-packages/jupyterlab/debuglog.py:56: UserWarning: An error occurred.
  warnings.warn("An error occurred.")
/Users/tparment/miniconda3/envs/rise/lib/python3.11/site-packages/jupyterlab/debuglog.py:57: UserWarning: FileNotFoundError: [Errno 2] No such file or directory: '/Users/tparment/git/rise/jupyterlab_rise/package.json'
  warnings.warn(msg[-1].strip())
/Users/tparment/miniconda3/envs/rise/lib/python3.11/site-packages/jupyterlab/debuglog.py:58: UserWarning: See the log file for details: /var/folders/9n/sxs31qhj1gnd6gk2v0ns8848000fn2/T/jupyterlab-debug-hoa28_43.log
  warnings.warn(f"See the log file for details: {log_path!s}")

so I see several improvements that can be done there

  • reword

    Change directory to the jupyterlab_rise directory

    into

    Change directory to the top folder of the cloned repo

    because there is a subfolder named jupyterlab_rise so it's confusing, esp. as the toplevel repo may not be called that

  • either add a dependency so that jupyter-labextension gets installed by pip install -e . or instruct developers to pip install jupyter like I did (maybe there's a better way to do that ?)

  • actually provide a package.json if that's what it takes ?

@parmentelat parmentelat added the bug Something isn't working label Dec 19, 2023
@Y3drk
Copy link

Y3drk commented Apr 10, 2024

Ran into pretty much the same issue when following the instruction. After the first two steps (cloning the repo and moving into ./rise/jupyterlab_rise) the next step (pip install -e ".[test]") returns the following

ERROR: file my/path/rise/jupyterlab_rise does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

The same command seems to be working in the main repository directory, but when trying to follow it up with the next step jupyter labextension develop . --overwrite it once again fails with

Installing my\path\rise\jupyterlab_rise\labextension -> jupyterlab-rise
Building extension in D:\CV_rozmowy_staz\Enelpol\szkolenia_nokia\other\rise\jupyterlab_rise
C:\Python312\Lib\site-packages\jupyterlab\debuglog.py:56: UserWarning: An error occurred.
  warnings.warn("An error occurred.")
C:\Python312\Lib\site-packages\jupyterlab\debuglog.py:57: UserWarning: FileNotFoundError: [Errno 2] No such file or directory: 'my\\path\\rise\\jupyterlab_rise\\package.json'
  warnings.warn(msg[-1].strip())
C:\Python312\Lib\site-packages\jupyterlab\debuglog.py:58: UserWarning: See the log file for details: C:\Users\me\AppData\Local\Temp\jupyterlab-debug-i4oz45fp.log
  warnings.warn(f"See the log file for details: {log_path!s}")

and the log of the error is as follows:

Installing D:\my_path\rise\jupyterlab_rise\labextension -> jupyterlab-rise
Building extension in D:\my\path\rise\jupyterlab_rise
Traceback (most recent call last):

  File "C:\Python312\Lib\site-packages\jupyterlab\debuglog.py", line 47, in debug_logging
    yield

  File "C:\Python312\Lib\site-packages\jupyterlab\labextensions.py", line 163, in start
    ans = self.run_task()
          ^^^^^^^^^^^^^^^

  File "C:\Python312\Lib\site-packages\jupyterlab\labextensions.py", line 252, in run_task
    develop_labextension_py(

  File "C:\Python312\Lib\site-packages\jupyterlab\federated_labextensions.py", line 180, in develop_labextension_py
    build_labextension(base_path, logger=logger)

  File "C:\Python312\Lib\site-packages\jupyterlab\federated_labextensions.py", line 208, in build_labextension
    builder = _ensure_builder(ext_path, core_path)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "C:\Python312\Lib\site-packages\jupyterlab\federated_labextensions.py", line 266, in _ensure_builder
    with open(osp.join(ext_path, "package.json")) as fid:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

FileNotFoundError: [Errno 2] No such file or directory: 'my\\path\\rise\\jupyterlab_rise\\package.json'

There is a possibility that I've done something wrong or omitted some steps in my env / jupyter setup, but seeing that other people had encountered the same issue it might not be the case.

I am working on Windows 11, with pip 24.0, node 20.9.0 and python 3.12.0

I would be really grateful for any clarification/help in that regard.

Thanks

@krassowski
Copy link

@Y3drk since you are on Windows, does enabling symbolic links help by any chance?

On Windows, symbolic links can be activated on Windows 10 or above for Python version 3.8 or higher by activating the ‘Developer Mode’. That may not be allowed by your administrators. See Activate Developer Mode on Windows for instructions.

Ref: https://jupyterlab.readthedocs.io/en/stable/extension/extension_tutorial.html#build-and-install-the-extension-for-development

@Y3drk
Copy link

Y3drk commented Apr 10, 2024

@krassowski I've read about it but haven't tried it. I don't have much time to spare so I can't promise it, but if I ever go back to it I'll try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants