# Input Function Not Working

**URL:** <https://discourse.jupyter.org/t/input-function-not-working/2290>\
**Category:** Notebook\
**Created:** [October 2, 2019, 3:53pm UTC](https://discourse.jupyter.org/t/input-function-not-working/2290 "2019-10-02T15:53:05Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [March 8, 2024, 8:16pm UTC](https://discourse.jupyter.org/t/input-function-not-working/2290/11 "2024-03-08T20:16:04Z")

</div>

> [@Yi1](#):
>
> I tried Jupyter Notebook, not Lit.

Okay, it was JupyterLite. That is using the Pyodide kernel.

In the screenshot you show of the ‘Try Jupyter’ page, the paragraph directly above where you highlighted Jupyter Notebook says with warnings:

> ⚠ **Experimental** ⚠ several of the environments below use the [JupyterLite project](https://jupyterlite.readthedocs.io/en/latest/) to provide a self-contained Jupyter environment that runs in your browser. This is experimental technology and may have some bugs, so please be patient and report any unexpected behavior in [the JupyterLite repository](https://github.com/jupyterlite/jupyterlite/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)."

Anyway, this explains why you are seeing the need for `await()`.

> [@Yi1](#):
>
> I am not sure how I could start a “true Python kernel”.

I suggested how to do that in the last paragraph [of the post right above yours from today](https://discourse.jupyter.org/t/input-function-not-working/2290/7).

> [@fomightez](#):
>
> I’d suggest using a typical, full-Python kernel backed system for testing out when you may have encountered a JupyterLite limitation, by going [here](https://github.com/binder-examples/requirements) and pressing `launch binder`. Then when the session comes up in your browser, open a new notebook to get a remote notebook running with a full, typical Python-backed kernel on a temporary remote system, and paste in the code you are trying. That way you’ll know the root cause and can look for JupyterLite/Pyodide-compatible work arounds or decide to just use a typical Python-backed kernel for your efforts.

I’ll add that if the full Python kernel is one you want, you can set up GitHub repos or gists to already install the things you want [using configuration files that the MyBinder service recognizes](https://mybinder.readthedocs.io/en/latest/using/config_files.html) that often just boil down to listing what you need. Examples that you can launch with the dependencies listed in `requirements.txt` already by pressing ‘launch binder’ at the sites:

- [example Github repo](https://github.com/fomightez/cluster_analysis-binder)
- [example gist](https://gist.github.com/jtpio/83b0b625cb3b6e05d7f3d8714f98182e)

**And keep in mind those are temporary sessions. If you make anything useful, download it to your local system immediately.** You can upload notebooks you have to a fresh temporary Jupyter session.

* * *

* * *

As for the issue with your code with `num = int(await(input("number please:")))` …

The easiest solution is to remove the `await() `and use a full Python kernel (ipykernel) using the method I said above.

As for the issue with your code with `num = int(await(input("number please:")))`, the input part is supposed to be `await input()`, see [here](https://stackoverflow.com/a/78094369/8508004).

If you make a cell with that as the content:

```python
num = int(await(input("number please:")))

```

And then run it and enter a number. In the next cell you can put `num` in the cell and execute it and it will give you the value.

But as you’ve found you cannot do the loop you want to do using JupyterLite / Pyodide kernel at this time. See [here](https://github.com/jupyterlite/jupyterlite/issues/609#issuecomment-1104958736) for much the same question in a less complex context compared to your while loop in the same cell. Note that putting `type(raw)` after the `await input()` line doesn’t result in displaying the type in the previous cell.

> And the second after await the code is not processed further

The reply is there:

> We did not find a way around this for now. But if you have ideas please share them in the issue I just mentioned

In theory there is complex way to do it with [a service worker](https://github.com/jupyterlite/jupyterlite/issues/275#issuecomment-1407074263); however, at this time it remains a challenge to make it something closer to what is expected. More about what is going on and options in JupyterLite / Pyodide [here](https://discourse.jupyter.org/t/jupiterlab-input-function-not-working/17951/2).

---

_[View the full topic](https://discourse.jupyter.org/t/input-function-not-working/2290)._
