Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Installing External Libraries

Scheduled Pinned Locked Moved Solved JupyterHub
7 Posts 3 Posters 416 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thpuffin
    wrote on last edited by
    #1

    Is it possible to install external python libraries using pip via the terminal?

    robiR 1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    replied to thpuffin on last edited by girish
    #0

    @thpuffin You have to run inside the notebook and not in the Web Terminal of JupyterHub app.

    To understand why, please see https://docs.cloudron.io/apps/jupyterhub/#how-it-works . But at a high level, there is the "hub" which is essentially an authenticator/login service. The Web Terminal will give you access to this container. This container like other cloudron app containers is readonly.

    When a user logs in, a "notebook container" is created for each user. This way each user has a virtual environment of their own. This container is read/write and user can install anything. There is a "shell" from within jupyterlab itself and you have to run pip there. Also, see https://docs.cloudron.io/apps/jupyterhub/#notebook-persistence about persistence of any additional package you install.

    T 1 Reply Last reply
    2
  • robiR Offline
    robiR Offline
    robi
    replied to thpuffin on last edited by
    #2

    @thpuffin only if they're in /app/data and not in /app/code

    Life of sky tech

    T 1 Reply Last reply
    0
  • T Offline
    T Offline
    thpuffin
    replied to robi on last edited by
    #3

    @robi I'm not able to install them because they still want to install it in the read-only directories for the base env. If I create an virtual environment using venv, I also won't be able to choose it as the kernel since there is no root system access.

    Not sure if I'm missing something.

    girishG 1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    replied to thpuffin on last edited by girish
    #4

    @thpuffin You have to run inside the notebook and not in the Web Terminal of JupyterHub app.

    To understand why, please see https://docs.cloudron.io/apps/jupyterhub/#how-it-works . But at a high level, there is the "hub" which is essentially an authenticator/login service. The Web Terminal will give you access to this container. This container like other cloudron app containers is readonly.

    When a user logs in, a "notebook container" is created for each user. This way each user has a virtual environment of their own. This container is read/write and user can install anything. There is a "shell" from within jupyterlab itself and you have to run pip there. Also, see https://docs.cloudron.io/apps/jupyterhub/#notebook-persistence about persistence of any additional package you install.

    T 1 Reply Last reply
    2
  • T Offline
    T Offline
    thpuffin
    replied to girish on last edited by
    #5

    @girish I see.

    From what I understand, each user has a virtual environment of their own. Each user can install their own packages using the notebook itself, and not the terminal.

    That means that if a user were to have multiple virtual environments, then I would need to set it up using ipykernel via the notebook too?

    girishG 1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    replied to thpuffin on last edited by
    #6

    @thpuffin Correct, each user can install their own packages. I am not 100% sure about the right terminology but.. there's only one environment per user. Inside each environment, a user can have many notebooks.

    Also, if you want to have a package pre-installed for all the users, you can just use a custom image - https://docs.cloudron.io/apps/jupyterhub/#selecting-a-notebook-image . You can use any of the notebook images from the upstream project - https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html

    T 1 Reply Last reply
    0
  • T Offline
    T Offline
    thpuffin
    replied to girish on last edited by
    #7

    @girish Thanks for the answer. Having one and only one environment per user is quite the inconvenience 😞

    1 Reply Last reply
    0
  • girishG girish marked this topic as a question on
  • girishG girish has marked this topic as solved on

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.