copy jupyter lab notebooks from github - jupyter-notebook

We have jupyter lab installed on kubernetes and notebooks uploaded to github. I want to copy these notebooks to another instance of jupyter lab. So, I logged into the pod and ran git clone command. notebooks were copied and they are visible in UI too. But other users are unable to see these files as we have user specific pods. Can someone please suggest how to make these notebooks available to other users in read only mode.

Related

How to open a local Jupyter Notebook directly on Google Colab without going for the extra step of uploading it on Google Drive?

I would like to load my jupyter notebook from my local repo directly on Colab, without uploading it first on GDrive. I'm well aware of the possibility to open Github notebooks directly on Colab, but that's not what I'm trying to make, since I would like to directly open notebooks from my local repo and then have the freedom to commit and push whenever I want. Is this possible or do I have to just give up and upload a copy on GDrive and then download the .ipynb everytime I want to save locally?
You can use my library to open Jupyter Notebook and open any local notebook in the same machine instance.
!pip install kora -q
from kora import jupyter
jupyter.start()
Then click the shown link. It should list local ipynb files. You can then click them to open and edit the files directly.

How to change Users folders in jupyter notebook and jupyterlab?

I have a question about jupyter notebook and jupyter lab and anaconda?
Does someone knows how to change the users folder from User a to b as an example?
I mean like I have 2 users in my PC and I want to use my secondary users folder in jupyter notebook and jupyterlab instead of my primary user folder.
Thank you
Create custom launching scripts for each user. The working directory can be set for jupyter lab using command line parameters:
jupyterlab --NotebookApp.notebook_dir=<directory_name>
(or using Jupyter config).
See related answer for the post: (How to change the Jupyter start-up folder)[https://stackoverflow.com/a/45515095/3247880]

JupyterLab not loading environment variables

I have some passwords and such set in my bash_profile that I want to be able to access from within Jupyter notebooks. They are successfully loaded whenever I use just a Jupyter notebook, but not when I use JupyterLab.
I am using Anaconda, and I double checked that the location of my JupyterLab and JupyterNotebook's are the same using which jupyter/jupyter-lab/jupyter-notebook and they do all point to my Anaconda bin directory. I also made sure the anaconda3/bin directory is in my bash profile and that the conda environment was activated.
Whenever I run os.environ in a notebook using Lab versus just a plain notebook I expect the same output, however the Lab instance does not load anything I have manually added to my profile while a plain notebook does.

Creating Folder Failed on jupyter notebook

When I click "New" to create text file,folder, and python3 file on jupyter notebook, it shows that "Creating File Failed" and "An error occurred while creating a new file". Could you please give me some advice about how to solve this problem ? The screenshot is attached. Thank you very much !
Some details: I use pip install jupyter to install jupyter notebook in Linux environment. You can see from the attached screenshot that there is a new icon near to the upload icon on the upper right, then I click the black upside-down triangle on the new icon, then I choose folder. This is the process in which I try to create a new folder on jupyter notebook.
Use the --user tag with pip
The reason you cannot create a folder is because you do not have permission. This could be that you are not a on the sudo list or that you are not the owner of the folder where you are trying to create a new folder.
You can potentially avoid these problems by removing your jupyter install and re-installing with the '--user' option. Be sure that you have configured a non root user with sudo privileges and that you are logged in as that user. Try the following:
pip uninstall jupyter
pip install jupyter --user
Run notebook as usual:
jupyter notebook
One more thing, be sure that you are trying to create a folder in your home directory. If you are user "Bob", make sure you are creating the folder in /home/bob/ You are the owner of this directory and should be able to modify it as you wish.
Further reading:
link1
link2
I have found reasons that I cannot create new folder/file on jupyter notebook. Reason is that I directly open jupyter notebook in the anaconda3 environment, that's incorrect! Intuitive description is that I should switch from /home/${USER}/anaconda3 to /home/${USER}/anaconda3/bin, because when I use whereis jupyter, I find that jupyter is under /~/bin directory. So, I have a try and succeed !

Open multiple jupyter notebook with different extension config

I share a linux server user with my teammate, and we used the same jupyter notebook server together.
However recently I found some interesting plugins, so I created a new jupyter notebook directory ~/.my_jupyter, which is a copy of origin ~/.jupyter, and open jupyter notebook with config=/path/to/.my_jupyter/my_config.json then install some plugin by jupyter_contrib_nbextensions.
But when I enable a plugin in my jupyter, the other jupyter enable that plugin too. I found that new jupyter still reference the plugin status by origin .jupyter/nbconfig.
I am looking for a way to change nbconfig path just in my jupyter, hope someone can help me figure it out.
Thanks
Finally figure it out.
Create new tmux session and do following line in terminal:
export JUPYTER_CONFIG_DIR=/path/to/.my_jupyter
which .my_jupyter is configure path of your jupyter like origin ~/.jupyer.

Resources