Libraries and scripts for notebooks

Watson Studio includes many preinstalled libraries for Python and R in its runtime environments :

If you want to work with Scala, you should use a Spark environment.

List installed libraries

To see the list of installed libraries in your Watson Studio environment:

  1. Click your project’s Environments tab.
  2. From the Environment definitions list, click the environment definition you want to use. This opens the environment definition details page where you can see the installed libraries.

To see the list of installed libraries from a notebook, run the appropriate command from a notebook cell:

  • Python: !pip list --isolated
  • R: installed.packages()

Import an installed library

To import an installed library into your notebook, run the appropriate command from a notebook cell with the library name:

  • Python: import library_name
  • R: library(library_name)

You can write a script that includes multiple classes and methods and then import the script into your notebook. Watch this video to see how to use the Apache Spark Machine Learning Library.

Figure 1. Video iconUse the Apache Spark Machine Learning library
This video shows how to use the machine learning library in a notebooks

Learn more