Installing External Libraries
-
Is it possible to install external python libraries using pip via the terminal?
-
@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.
@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.
-
Is it possible to install external python libraries using pip via the terminal?
-
@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.
-
@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.
@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.
-
@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.
@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?
-
@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?
@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
-
@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
@girish Thanks for the answer. Having one and only one environment per user is quite the inconvenience

-
G girish marked this topic as a question on
-
G girish has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login