Pip install fastai :)


(Jeremy Howard (Admin)) #1

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.)


Personal DL box
(Zarak) #2

Great news!

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


(Vishal Pandey) #3

Awesome…


(JV) #4

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


(Nikhil) #5

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


(Reshama Shaikh) #6

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


(Nikhil) #7

Thanks.
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.


(Reshama Shaikh) #8

that’s true…


(Nikhil) #9

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


(Pierre Guillou) #10

It will install the last version of the fastai library ?


(Nikhil) #11

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


(Gourav Shaw) #12

It is giving this error


#13

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


(Xu Zhang) #14

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


(Hafidz Zulkifli) #15

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.


#16

THANK GOD!

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!!


#17

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.


#18

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


(jackytsai) #19

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 *
3
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 ?


(niranjan) #20

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
Regards,
Thanks