'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 1:[1]

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.

Solution 2:[2]

If you are not able to find the package, you might have probably downloaded the package instead of installing it.

Incorrect command:

!pip download transformers

Correct command:

!pip install transformers

Next, in order to find the package run the following command:

!pip show transformers

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 sauravjoshi23