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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Installing External Libraries

    JupyterHub
    3
    7
    389
    Loading More Posts
    • 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
      thpuffin last edited by

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

      robi 1 Reply Last reply Reply Quote 0
      • girish
        girish Staff @thpuffin last edited by girish

        @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 Reply Quote 2
        • robi
          robi @thpuffin last edited by

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

          Life of Advanced Technology

          T 1 Reply Last reply Reply Quote 0
          • T
            thpuffin @robi last edited by

            @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.

            girish 1 Reply Last reply Reply Quote 0
            • girish
              girish Staff @thpuffin last edited by girish

              @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 Reply Quote 2
              • T
                thpuffin @girish last edited by

                @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 1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @thpuffin last edited by

                  @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 Reply Quote 0
                  • T
                    thpuffin @girish last edited by

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

                    1 Reply Last reply Reply Quote 0
                    • Topic has been marked as a question  girish girish 
                    • Topic has been marked as solved  girish girish 
                    • First post
                      Last post
                    Powered by NodeBB