!nbdev_build_lib ImportError: cannot import name '_documents'... in Colab

Hi @wjlgatech welcome to the forum!

That issue actually happens to me on my local machine when I have nbdev installed globally but running it within a virtual environment.
I’m not too familiar with Colab but, did you create a venv there? (e.g. by running python -m venv .venv)?

If so, try to uninstall nbdev from the global colab modules:

  1. If you’re in the venv, deactivate.
  2. pip uninstall nbdev.
  3. Activate the venv again
  4. pip install nbdev.

Hopefully that helps.

In case you missed it, there are a few extra steps for Colab at nbdev in colab tutorial | nbdev_colab_helper
Also, sounds like others had issues too Using Nbdev with Google Colab - #21 by Mukei

Happy coding! :slight_smile:

1 Like