0

Update: I conclude from discussions with others that this is a genuine bug; the web versions of JupyterLab do not currently allow you to access files.

When I run JupyterLab over the web, e.g. from Jupyter.org/try, I have several difficulties with files. I think something got corrupted -- how can I get a normal JupyterLab environment? Here are some of the problems:

1) I can not access files from my machine. The command os.chdir("C:") gives the error

FileNotFoundError: [Errno 44] No such file or directory: 'C:'

2) I can not access files from the web. First the command import pandas as pd gives the error

Could not import the lzma module. Your installed Python is incomplete

Then the command pd.read_csv("https://data.nasa.gov/api/views/7qz6-zrqt/rows.csv") (which reads a readily accessible csv file) gives the error

URLError: <urlopen error unknown url type: https>

3) I can not access the files that I upload into the folders visible at left of the screen. The command pwd returns '/home/pyodide' but no amount of moving around from that directory seems to get me to a directory with the files I uploaded or the notebooks I created.

4) I can not delete some of the files visible in the folders at the left of the screen. E.g.: I don't remember uploading or modifying the file "Lorenz.ipynb". I try to delete it, and I press "Delete" at this screen, but the file remains.

enter image description here

I also have JupyterLab installed directly on my machine, where it runs without these problems -- but I am trying to convince people that JupyterLab by web is an easy way of getting into Python, and these errors are preventing that. How can I get JupyterLab working normally over the web?

Matt F.
  • 145
  • 7

1 Answers1

1

Sorry, I (and others) didn't see your question earlier. I'm going to largely refer you to where similar things are discussed more recently as this is a very rapidly developing niche.
The short answer is I would suggest not yet encouraging those just get getting into Python to use JupyterLite, which is what you are referring to when you say, "When I run JupyterLab over the web, e.g. from Jupyter.org/try,"[at this time]. You'll note that there and at the JupyterLite site itself it status is stated as "experimental", "cutting-edge", "unofficial", etc.

How can I get JupyterLab working normally over the web?

Go to here and click launch binder. This will give you a temporary session that will time out after ten minutes inactivity on a remote linux-based machine. The Jupyter in use there is full Python-backed. You can upload files by dragging them in the file navigator and you can download new or modified files from the remote machine back to your system. I go more into using it here. Make sure you note there is a safety net for notebooks even if the session times out.

At this time you'll have a better experience directing folks to MyBinder-served sites with full Python kernels on actual remote machines to address your desire "to convince people that JupyterLab by web is an easy way of getting into Python".


If you want to keep using JupyterLite some, please check out the caveats referring to some of the issues you encountered (and more) at the following places:

UPDATE: Everything above referenced the pyolite kernel that was driving JupyterLite at the time. A new kernel compatible with JupyterLite, xeus-python, was announced. That one enables time.sleep() to work in a notebook, more like a typical Python kernel.

Wayne
  • 6,607
  • 8
  • 36
  • 93
  • Thanks — I am glad to know that these issues are known and being addressed. In the end I provided detailed instructions for using Idle or JupyterLab locally (including terminal commands for installing packages with pip), and now that I have those, I think I’ll keep using them. If and when they break down I will explore JupyterLite with binder more thoroughly! – Matt F. May 13 '22 at 02:57
  • Just to be clear. I meant using a Jupyter environment on a remote computer via MyBinder as **opposed** to JupyterLite. Two very different alternatives. (You use of *with* was my concern.) MyBinder launched instances (not involving JupyterLite) will be much closer to what you are used to for now. You just have to make them clear it is remote and temporary. – Wayne May 13 '22 at 15:10
  • I was just encountering the "unknown url type https" issue. Is that tracked / explained somewhere? – Andreas Mueller Sep 30 '22 at 19:59
  • 1
    Isn't that [described and tracked here](https://github.com/jupyterlite/jupyterlite/issues/744#issue-1313914689)? – Wayne Sep 30 '22 at 21:00