google-colaboratory

Where to find the existing package installed in the google Colab


I want to check if some packages are installed in the Colab. What is specific folder for storing the installed packages (e.g., keras)?


Solution

  • You can use the pip tool to list installed Python packages and their locations on the system:

    !pip list -v | grep [Kk]eras
    # Keras                    2.2.5           /usr/local/lib/python3.6/dist-packages pip      
    # Keras-Applications       1.0.8           /usr/local/lib/python3.6/dist-packages pip      
    # Keras-Preprocessing      1.1.0           /usr/local/lib/python3.6/dist-packages pip      
    # keras-vis                0.4.1           /usr/local/lib/python3.6/dist-packages pip      
    

    Note that in Colab and other Jupyter notebook frontends, the ! character is used to execute a shell command.