Google Colab installation of fastai

Trying to get started on Google Colab and following the guidance from here:

I made sure my notebook is running Python 3 and on a GPU. Did not clone a notebook from Github, instead I am running an empty notebook for my experiment.

Error on running this line

!curl -s | bash

This is the error I get:

Updating fastai...
spacy 2.0.18 has requirement numpy>=1.15.0, but you'll have numpy 1.14.6 which is incompatible.

Any hints on a workaround?

I just tried

import fastai

and got no errors! Is it already installed!?

Currently colab has 1.0.41 already installed (along with Pytorch). So, you can ignore the manual install unless you want latest (see for changes across releases).
Also, I don’t think the spacy warning will break the kernel.

1 Like

hi u can try this :slight_smile: i always use like this :slight_smile:
!curl | bash try

i guess u can update with this

!pip install numpy==1.15.0

Thanks! It seems I do not need to install anything like @AbuFadl said.

!curl | bash

is giving an error as follows:
. bash: line 1: syntax error near unexpected token newline' bash: line 1:<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>’
Am I making some syntax error?? is preinstalled on google colab. You don’t need the script.

But what if we wish to make some changes in the AWD-LSTM architecture and then run the python code? I mean where are the fastai files kept in colab after installation?

@ulmfitter you’d be better off declaring a custom AWD-LSTM architecture in a notebook cell and then passing it into Learner instead of modifying the source code.

Thankyou. That is also a good option. Still if we want to edit the source code, how can we do it ? I dnt understand why the changs ain’t getting reflected when I have the correct path for ?

In Colab the source is hidden away at where the install is. You can find them with a !pip show fastai. Then if you upload a new .py file you’ll need to restart your instance to use the new version.