'how to install octave packages on google colab?

I need to run some matlab code on google colab that needs 'image' package. I tried pkg install -forge image but that through an error. please help!



Solution 1:[1]

For me, I need to install "image" package.

My solution is, run the following command in colab?

!apt-get install -y liboctave-dev

Then create a new matlab file "install.m" with code:

pkg install -forge image

then run the following command in colab?

!octave -W yourPath/install.m 

which you only need to run once.

After this, when you need to run the .m file that requires the "image" package, add:

pkg load image

to the beginning of the code.

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 WhiteCrow_dolce