Upgrading Python packages and R packages

You can add other Python packages or R packages. You can also update the versions of existing Python packages and R packages in your IBM® Cognos® Analytics for Jupyter Notebook Server installation.

To accomplish this task, you edit the files additional_pip_packages.txt and additional_conda_packages.txt.

Note: The files additional_pip_packages.txt and additional_conda_packages.txt follow the standard requirements.txt file format that is used in Python, as specified in the PyPA Reference Guide (https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format).

Before you begin

Decide whether you need to upgrade. Check to see which versions of Python packages are in your current installation.
Tip: To see what is in the modules available in the Notebook environment, type the following in a notebook cell:

`!pip list --isolated`

You can also, for most Python packages, load a module at runtime for the specific Notebook with the pip command. For example, type the following in a Notebook cell:

!pip install --user prettyplotlib`

Procedure

  1. Edit the file jupyter_installation_location/dist/scripts/additional_pip_packages.txt
    Tip: You can add Python packages by specifying them in the additional_pip_packages.text file.
  2. Stop the server:

    For Linux, run jupyter_installation_location/dist/scripts/unix/stop.sh

    For Windows, run jupyter_installation_location/dist/scripts/windows/stop.bat

  3. Rebuild the image:
    For Linux, run jupyter_installation_location/dist/scripts/unix/build.sh

    For Windows, run jupyter_installation_location/dist/scripts/windows/build.bat

  4. Restart the server:

    For Linux, run jupyter_installation_location/dist/scripts/unix/start.sh

    For Windows, run jupyter_installation_location/dist/scripts/windows/startup.bat

  5. Edit the file jupyter_installation_location/dist/scripts/additional_conda_packages.txt and repeat steps 2-4.
    Tip: You can add both Python packages and R packages by specifying them in the additional_conda_packages.text file.