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

Cannot run jpterm #63

Closed
ddkn opened this issue Dec 4, 2023 · 7 comments
Closed

Cannot run jpterm #63

ddkn opened this issue Dec 4, 2023 · 7 comments

Comments

@ddkn
Copy link

ddkn commented Dec 4, 2023

Hello,

I have installed jpterm==0.1.22 and it is not able to run,

$ jpterm --server  http://127.0.0.1:8888/lab?token=8336db287151da7b73b663fd37bc2dd30d5ac1c26ad21b19
Error during application startup
Traceback (most recent call last):
  File "/home/ddkn/.local/lib/python3.10/site-packages/asphalt/core/runner.py", line 110, in run_application
    event_loop.run_until_complete(coro)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/home/ddkn/.local/lib/python3.10/site-packages/txl/app.py", line 21, in start
    await super().start(ctx)
  File "/home/ddkn/.local/lib/python3.10/site-packages/asphalt/core/component.py", line 162, in start
    await super().start(ctx)
  File "/home/ddkn/.local/lib/python3.10/site-packages/asphalt/core/component.py", line 112, in start
    self.add_component(alias)
  File "/home/ddkn/.local/lib/python3.10/site-packages/asphalt/core/component.py", line 101, in add_component
    component = component_types.create_object(**config)
  File "/home/ddkn/.local/lib/python3.10/site-packages/asphalt/core/utils.py", line 182, in create_object
    plugin_class = self.resolve(type)
  File "/home/ddkn/.local/lib/python3.10/site-packages/asphalt/core/utils.py", line 163, in resolve
    raise LookupError(f"no such entry point in {self.namespace}: {obj}")
LookupError: no such entry point in asphalt.components: remote_kernelspecs

I have the following installed,

txl==0.1.22
asphalt==4.12
jupyterlab==4.0.9
jpterm==0.1.22

Assuming asphalt has an issue?

Appreciate any feedback!

@davidbrochart
Copy link
Owner

Thanks for reporting the issue.
Could you try in a fresh environment with pip install jpterm==0.1.24? After installation, make sure you have version 0.1.24 for all packages in : pip list | grep txl.

@ddkn
Copy link
Author

ddkn commented Dec 4, 2023

Thanks for the response! Here is what I have done so far:

$ cd ~/tmp
$ python3 -m venv jpterm
$ . jpterm/bin/activate
(jpterm)$ pip install jupyterlab jpterm
$ pip list | grep txl
txl                       0.1.24
txl_cell                  0.1.24
txl_console               0.1.24
txl_editors               0.1.24
txl_file_browser          0.1.24
txl_image_viewer          0.1.24
txl_jpterm                0.1.24
txl_kernel                0.1.24
txl_launcher              0.1.24
txl_local_contents        0.1.24
txl_local_kernels         0.1.24
txl_local_terminals       0.1.24
txl_markdown_viewer       0.1.24
txl_notebook_editor       0.1.24
txl_remote_contents       0.1.24
txl_remote_kernels        0.1.24
txl_remote_terminals      0.1.24
txl_terminal              0.1.24
txl_text_editor           0.1.24
txl_widgets               0.1.24
$ pip freeze | grep jpterm
jpterm==0.1.24
txl_jpterm==0.1.24

Then I ran jupyter lab --no-browser and got the following error:

$ jpterm --server http://localhost:8888/lab?token=4eb67a118
8268dd65bd8890f30b44e4615c934b2b1b3e341
Error during application startup
Traceback (most recent call last):
  File "/home/ddkn/tmp/jupyter/lib/python3.10/site-packages/asphalt/core/runner.py", line 1
10, in run_application
    event_loop.run_until_complete(coro)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/home/ddkn/tmp/jupyter/lib/python3.10/site-packages/txl/app.py", line 21, in start
    await super().start(ctx)
  File "/home/ddkn/tmp/jupyter/lib/python3.10/site-packages/asphalt/core/component.py", lin
e 162, in start
    await super().start(ctx)
  File "/home/ddkn/tmp/jupyter/lib/python3.10/site-packages/asphalt/core/component.py", lin
e 116, in start
    await asyncio.gather(*tasks)
  File "/home/ddkn/tmp/jupyter/lib/python3.10/site-packages/txl_notebook_editor/components.
py", line 330, in start
    _kernelspecs = await kernelspecs.get()
  File "/home/ddkn/tmp/jupyter/lib/python3.10/site-packages/txl_remote_kernels/components.p
y", line 44, in get
    d = r.json()
  File "/home/ddkn/tmp/jupyter/lib/python3.10/site-packages/httpx/_models.py", line 761, in
 json
    return jsonlib.loads(self.content, **kwargs)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@ddkn
Copy link
Author

ddkn commented Dec 4, 2023

For context I am running on Kubuntu 22.04 with python 3.10

@davidbrochart
Copy link
Owner

It's jpterm --server http://localhost:8888/?token=4eb67a118 (without lab).

@ddkn
Copy link
Author

ddkn commented Dec 4, 2023

Giving it a try, we make some progress!

image

Opening a created notebook I can see it!

image

However, when starting a notebook I get this:

$ jpterm --server http://localhost:8888/?token=b6f246b12ca4eebfe1c84d1dd0cafa8df96b38f8b1d04620
╭──────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────╮
│ /home/ddkn/tmp/jupyter/lib/python3.10/site-packages/txl_launcher/components.py:39 in on_button_pressed                                                            │
│                                                                                                                                                                   │
│   36async def on_button_pressed(self, event: Button.Pressed) -> None:                    ╭────────── locals ───────────╮                                     │
│   37 │   │   document = self.documents[event.button.id]()                                     │ document = NotebookEditor() │                                     │
│   38 │   │   self.main_area.show(document)                                                    │    event = Pressed()        │                                     │
│ ❱ 39 │   │   await document.open()                                                            │     self = _Launcher()      │                                     │
│   40                                                                                          ╰─────────────────────────────╯                                     │
│   41                                                                                                                                                              │
│   42 class LauncherComponent(Component):                                                                                                                          │
│                                                                                                                                                                   │
│ /home/ddkn/tmp/jupyter/lib/python3.10/site-packages/txl_notebook_editor/components.py:104 in open                                                                 │
│                                                                                                                                                                   │
│   101async def open(self, path: str | None = None) -> None:                               ╭──────────── locals ────────────╮                                 │
│   102 │   │   if path is None:                                                                 │ kernel_name = Select.BLANK     │                                 │
│   103 │   │   │   kernel_name = await self.select_kernel()                                     │        path = None             │                                 │
│ ❱ 104 │   │   │   path = await self.create_empty_notebook(kernel_name)                         │        self = NotebookEditor() │                                 │
│   105 │   │   │   self.main_area.set_label(path)                                               ╰────────────────────────────────╯                                 │
│   106 │   │   self.path = path                                                                                                                                    │
│   107 │   │   self.ynb = await self.contents.get(self.path, type="notebook", format="json")                                                                       │
│                                                                                                                                                                   │
│ /home/ddkn/tmp/jupyter/lib/python3.10/site-packages/txl_notebook_editor/components.py:83 in create_empty_notebook                                                 │
│                                                                                                                                                                   │
│    80 │   │   │   i += 1                                                                       ╭──────────── locals ────────────╮                                 │
│    81 │                                                                                        │ kernel_name = Select.BLANK     │                                 │
│    82async def create_empty_notebook(self, kernel_name: str) -> str:                      │        self = NotebookEditor() │                                 │
│ ❱  83 │   │   kernel = self.kernelspecs["kernelspecs"][kernel_name]                            ╰────────────────────────────────╯                                 │
│    84 │   │   path = await self.get_untitled()                                                                                                                    │
│    85 │   │   ynb = ydocs["notebook"]()                                                                                                                           │
│    86 │   │   ynb.set(                                                                                                                                            │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: Select.BLANK

I assume we need to run the dev version for that as we need to create and run commands correct?

@davidbrochart
Copy link
Owner

Latest versions of Textual have breaking changes, it should work with pip install "textual<0.42".

@ddkn
Copy link
Author

ddkn commented Dec 7, 2023

Thanks for the heads up and all the help! I will close this issue.

Cheers,

@ddkn ddkn closed this as completed Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants