Table of Contents
I want to use my custom package in Google colab. I installed my package and other packages that are required.
But, when I import a package, let's say
logzero, Google colab says “Module Not Found Error”
Google colab Pro+ at the date 2022/10/29
My custom package is able to be built with poetry.
- The package installation is successful.
- I run
python -m pip list | grep logzero. Yes, logzero is surely installed.
- I run
python -m pip install logero -U. Nothing changes.
The following procedure was correct.
!pip install -r requirements.txtin the Google Colab interface.
Here are the commands.
# use pip install -r requirements.txt, instead
!cd /content/my-package && make clean && poetry export -f requirements.txt --output requirements.txt
!cd /content/my-package && pip install -r ./requirements.txt
What was the reason?
Unknown. But, Google colab's jupyter kernel may not recognize packages installed by
python setup.py install.