Search code examples
pythonmodulegoogle-colaboratory

how do you import my own module on colab?


I developp on colab and i save my code to create my own module qrl.py on drive but in my qrl.y i use !pip install deplacy and import numpy.

if i try to import the module i have the error following

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-58-62dca1f58066> in <module>()
----> 1 import grl

ModuleNotFoundError: No module named 'grl'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Solution

  • Trying copying the file to /content/ and build your module there. It's not able to access qrl.py (or grl) file.