Pip install fastai :)

Thanks to USF masters students @groverpr and @kcturgutlu, you can now

pip install fastai

This is really awesome work! :slight_smile: Let us know if you find any problems with it. I’ve tested lesson 1 of the DL course on AWS and it worked fine.

(There’s no need to use this if you use the conda environment we provide - this is largely for use outside of the course.)


Great news!

edit: Available on Kaggle kernels now: https://www.kaggle.com/datacanary/fastai-check



This is awesome! Really enjoying fast.ai! have a feeling the framework will take over the world…keep it up!


Hi, I can see more than 160 commits has been pushed to git from 2017-11-29. Will anyone update the package on Pypi?

Until that happens, you can use this method: pip library info

1 Like

I have no issues while using fastai on the server. I m able to execute code.

I asked because I wanted it run code in Kaggle notebook. It seems pip install fastai is only way to access fastai library in the notebook.

that’s true…

How did I forget this? We can use
pip install https://github.com/fastai/fastai/archive/master.zip


It will install the last version of the fastai library ?

Yes, supposed to do that. Check here https://stackoverflow.com/a/24811490/618018

1 Like

It is giving this error

will this work in google colab where i get a python notebook

I used this to install fastai library at virtualenv with python 3.5.2. When I used “import fastai”, it is okay. But When I use “from fastai.transforms import *”, I got the following error messages:
Traceback (most recent call last):

File “/home/xuzhang/.virtualenvs/virtual-py3/lib/python3.5/site-packages/IPython/core/interactiveshell.py”, line 2963, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File “”, line 1, in
from fastai.transforms import *

File “/media/projects/fastai/courses/dl1/fastai/transforms.py”, line 2, in
from .layer_optimizer import *

File “/media/projects/fastai/courses/dl1/fastai/layer_optimizer.py”, line 2, in
from .torch_imports import *

File “/media/projects/fastai/courses/dl1/fastai/torch_imports.py”, line 32
if pre: load_model(m, f’{path}/weights/{fn}.pth’)
SyntaxError: invalid syntax

I am using "lesson1.ipynb

Tested installing the latest version of fastai using the command

pip install https://github.com/fastai/fastai/archive/master.zip

Looks ok on Google Colab.

1 Like


I just spent the last 8 hours of my life trying to get this shit working and this one command solved all my problems , it’s a fucking miracle sweet Jesus, Mother Mary and Joseph, I can’t believe it!!

1 Like

Hi everyone,

Sorry for this noob question, but, is it necesary a GPU for install fastai package? because I have tried to install with pip taking into account the solutions you give here and I don’t get it. I want to use fastai package for random forest, so I don’t need gpu.

Was your error resolved? I’m getting the same error.

I got some error like

example 1 :

ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 from fastai.conv_learner import *
2 from fastai.dataset import *
4 import pandas as pd
5 import numpy as np

ModuleNotFoundError: No module named ‘fastai.conv_learner’

example 2
C:/Users/ADMIN/fastai\fastai\imports.py in ()
1 from IPython.lib.deepreload import reload as dreload
----> 2 import PIL, os, numpy as np, math, collections, threading, json, bcolz, random, scipy, cv2
3 import pandas as pd, pickle, sys, itertools, string, sys, re, datetime, time, shutil, copy
4 import seaborn as sns, matplotlib
5 import IPython, graphviz, sklearn_pandas, sklearn, warnings, pdb

ModuleNotFoundError: No module named ‘PIL’

how do I solve it ?

Hello Sir, I’m unable to install fastai package using pip.
The process terminates with this dialogue

    Collecting torch<0.4 (from fastai)
  Using cached https://files.pythonhosted.org/packages/5f/e9/bac4204fe9cb1a002ec6140b47f51affda1655379fe302a1caef421f9846/torch-0.1.2.post1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\NIRANJ~1\AppData\Local\Temp\pip-install-wilhlbrd\torch\setup.py", line 11, in <module>
        raise RuntimeError(README)
    RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

    Please follow the instructions at http://pytorch.org/ to install with miniconda instead.

Command "python setup.py egg_info" failed with error code 1 in C:\Users\NIRANJ~1\AppData\Local\Temp\pip-install-wilhlbrd\torch\ 

Please guide