Starting to use JupyterLab- simple problem.. please help

Hello. I am new to JupyterLab. I am a pure math PhD, but have limited computer skills,
and am right now just trying to get SageMath to work with JupyterLab.

I am running on a 2 year old macbook air running Catalina.

I was able to install jupyterlab, and am able to get it running. I Installed it using
python3 -m pip install. This installed everything into a site-package folder that is inside
Library/Python/3.9…

What I am trying to do, is to set a PATH in my Zshell .zshrc file to be able to start
jupyterlab from an outer folder. I added a simple command to do this, within the
.zshrc file, and it looks like this is being read. When I try to run jupyterlab from
an outer folder (in ZShell), it says I don’t have permission.

I have spent 4 hours online looking into this, and I can see in the documentation
I can try to set up some kind of jupyter_application.config.py file in my jupyter
config directory (I found this, and it is in the right place). I tried using the command
$ jupyter notebook --generate-config, but this does not seem to work. I tried
nano to create a python file with the name: jupyter_notebook_config.py
(or jupyter_application_config.py; I’ve tried both). From the documentation,
I tried setting NotebookApp.allow_rootBool = True.

I have seen on StackOverflow, on windows machines, this is supposed to be:
c.NotebookApp.allow_rootBool= True. (This also did not work.)

Anyway, nothing has worked. This seems like it would be a simple thing.
All I want to do is be able to start jupyterlab, in ZShell, from an outer folder.

If anybody could help, I would appreciate it.

You may find a non-system install of the sage/jupyter stack would be more predictable and reproducible. I recommend installing mambaforge, leaving that base environment alone, and then creating a managed environment that has just the stuff you need.

So, given a minimal environment.yml:

channels: [conda-forge]
packages:
  - jupyterlab >=3,<4
  - python >=3.7
  - sage >=9,<10

Then, the first time, and any time you want to change environment.yml:

mamba env update --file environment.yml -n my-jupyter-sage-env

… and in each shell where you start a jupyter application:

source activate my-jupyter-sage-env

This will (temporarily) update your $PATH to prefer ~/<install path>/envs/my-jupyter-sage-env/bin.

2 Likes