Fastai v2 chat

You can just do pip install nbdev, that module is now on pypi.

As I mentioned, I did, but even import nbdev failed.

I’ll take a look

1 Like

It works for me locally, but not in colab. Which are you doing?

Hi Jeremy,

I’m working on Colab.

In colab this works for me:

!git clone https://github.com/fastai/nbdev.git
!cd nbdev && pip install -e .
4 Likes

Something odd going on in colab. pip install nbdev also works fine locally, but not in colab.

1 Like

I’m not seeing this issue, I was able to install both and do from fastai2.basics import *

!pip install torch torchvision feather-format kornia pyarrow Pillow wandb --upgrade 
!pip install git+https://github.com/fastai/fastai2
!pip install nbdev

(however import nbdev does fail)

Were you able to run any piece of code after that? untar_data for example

Yes. untar_data worked.

1 Like

I see now what you mean by it won’t install. So I can still use the library (I think sgugger did something to temporarily let us do this) but investigating where the pip packages are I just have a nbdev-0.0.2.dist-info folder

From what I’m reading I think it needs a __init__ file? (edit looks like Jeremy already spotted that just before my post :slight_smile: )

After a few test (had to, so not to make confirmation of a fake success), Jeremy’s workaround solved it, now import works fine in Colab. Thank you all for the great support.

nbdev is now fixed on pypi for Colab. So you can just pip install nbdev :slight_smile:

2 Likes

Hello, I was doing the fastai2 code walkthrough, but things broke after the recent nbdev refactoring. Alas, I’m not a Python expert (yet). Can someone help me to figure out what is going wrong and how to fix it?

from nbdev.showdoc import *

AssertionErrorTraceback (most recent call last)
in
----> 1 from nbdev.showdoc import *
/dl/fastai_dev/dev/nbdev/showdoc.py in
6 #Cell
7 from .imports import *
----> 8 from .export import *
9 from .sync import *
10 from IPython.display import Markdown,display
/dl/fastai_dev/dev/nbdev/export.py in
199 #Cell
200 #Catches any from nbdev.bla import something and catches nbdev.bla in group 1, the imported thing(s) in group 2.
–> 201 _re_import = re.compile(r’^(\s*)from (’ + Config().lib_name + ‘.\S*) import (.*)$’)
202
203 #Cell
/dl/fastai_dev/dev/nbdev/imports.py in init(self, cfg_name)
26 while cfg_path != Path(’/’) and not (cfg_path/cfg_name).exists(): cfg_path = cfg_path.parent
27 self.config_file = cfg_path/cfg_name
—> 28 assert self.config_file.exists(), “Use Config.create to create a Config object the first time”
29 self.d = read_config_file(self.config_file)[‘DEFAULT’]
30
AssertionError: Use Config.create to create a Config object the first time

This line can’t work if you aren’t in the fastai2 folder, where there is a config file.

I was running the dl/fastai_dev/dev/01_core_foundation notebook, so I am in the dev folder. Which config file is it looking for?

fastai_dev doesn’t work with nbdev, you should be in the fastai2 repo now.

Thanks for the hint. I had some issues after installing fastai2, but a restart of my docker container seems to have resolved the issue. Seems to be working now.

Thx for the help!

Is this a one time thing? How do we convert notebooks (which are in same directory with fastai2) to scripts now? Thanks

As explained in the README, you just type nbdev_build_lib. Changing repo is kind of a one-time thing but we will likely switch again when it’s time to release to put it in the normal fastai repo.

1 Like