Installing Jupyter Notebook (Offline mode)

Use the following steps to install Jupyter Notebooks in an offline environment.

Procedure

  1. Do the following steps using an online server:
    1. As the root user, run the following command to install the Python virtual environment.
      /usr/local/bin/pip3.5 install virtualenv
    2. Run the following command to create and activate a virtual environment.
      virtualenv jup_env
      . ./jup_env/bin/activate
      Note: Ensure that you include the 2 periods in the command.

      The cursor prompt changes to show that all further changes will affect the virtual environment.

      (jup_env) [root@ ~]#

      You can exit the virtual environment by entering the following command:

      deactivate
    3. Create the offline installation directory.
      mkdir ./jup_env/jupyterinstall
    4. Create a text file that is named constraints.txt and includes the following entries:
      backcall==0.1.0
      bleach==1.5
      html5lib==0.9999999
      parso==0.3.1
    5. Download the required packages to the offline folder.
      pip3.5 download -d ./jup_env/jupyterinstall jupyter==1.0.0 -c constraints.txt
      Note: This step uses the virtual environment instance of pip3.5. Do not change to /usr/local/bin/pip3.5.
    6. Compress the offline installation directory.
      tar -czvf jupyterinstall.tar.gz ./jup_env/jupyterinstall
    7. Copy the compressed file to the offline server.
      scp jupyterinstall.tar.gz root@<offline_host>:/home/sifsuser/
    8. Exit the virtual environment.
      deactivate
  2. Do the following steps using the offline server:
    1. Log in to the offline server as the root user.
    2. Decompress the offline installation folder.
      cd /home/sifsuser
      tar -xzvf /home/sifsuser/jupyterinstall.tar.gz
    3. Install Jupyter.
      /usr/local/bin/pip3.5 install --no-index --find-links=/home/sifsuser/jup_env/jupyterinstall/ jupyter
      Note: The command is all that is required to install Jupyter and its dependencies. In addition, there is a requirements.txt file in the /home/sifsuser/jupyterinstall directory in case an itemized list or a version controlled list of Python packages is required.