Problem with loading text files JupyterLab in python

There’s big warning indicating JupyterLab launches are experimental when you go to Try Jupyter page. You can read more about the impetus behind this here. You’ve stumbled upon something odd about it. (See my second part below.)

In general, you want to use JupyterLab running a full Python kernel for the best experience right now, especially for teaching.

Launch JupyteLab with a full Python kernel available from the MyBinder JupyterLab demo page.

Binder



Interestingly, my test code/notebook works? If you skip the %pip install and run the rest.

It is very strange. So for some reason, the file made by the %store magic is saved but doesn’t show in the JupyterLite file navigator??? Yet, numpy can see the text file and load it. Yet, if you make a text file via the launcher in JupyterLite, numpy cannot see it even though it shows in the file navigator.

So technically, np.loadtxt() works on JupyterLite; however, there is something odd about the files you see in the file navigator (or add that by dragging in or make using the launcher in JupyterLite) and what numpy sees. The flipside is the text file I made with %store doesn’t show up; yet can be used by np.loadtxt().

This comment looks pertinent to this issue from issue ‘File not found, but clearly uploaded. Openpyxl cannot be installed?’:

“- at present, files uploaded to your browser are not trivially available in the kernel” SOURCE: Comment by Nicholas (@bollwyvl)