When I want to pack my code developed in Colab into my package, I did
!nbdev_build_lib
It returned this error message:
Traceback (most recent call last):
File “/usr/local/bin/nbdev_build_lib”, line 5, in
from nbdev.export2html import nbdev_build_lib
File “/usr/local/lib/python3.7/dist-packages/nbdev/export2html.py”, line 15, in
from .showdoc import *
File “/usr/local/lib/python3.7/dist-packages/nbdev/showdoc.py”, line 12, in
from fastcore.docments import _docments, isclass, _clean_comment, _tokens, _param_locs, _get_comment
ImportError: cannot import name ‘_docments’ from ‘fastcore.docments’ (/usr/local/lib/python3.7/dist-packages/fastcore/docments.py)
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: