0

I have a package called boo which I install on google colab from a github repository. The installation process looks fine and results in success message Successfully installed boo-0.1. However import boo fails on first internal import.

I replicated the same installation steps in a local virtual environment and package worked, but not on collab.

Here are my steps and error trace:

!rm -rf sandbox
!git clone https://github.com/ru-corporate/sandbox.git
!pip install -r sandbox/requirements.txt 
!pip install sandbox/.

Alternatively, I tried

!pip install git+https://github.com/ru-corporate/sandbox.git@master

The error trace is:

ModuleNotFoundError                       Traceback (most recent call last)

<ipython-input-7-fc0b1d036b35> in <module>()
----> 1 import boo

/usr/local/lib/python3.6/dist-packages/boo/__init__.py in <module>()
----> 1 from boo.boo import download, build, read_dataframe, files
      2 from boo.views.whatis import whatis

/usr/local/lib/python3.6/dist-packages/boo/boo.py in <module>()
      3 from tqdm import tqdm
      4 
----> 5 from boo.file.download import curl

Basically, from root __init__.py the import goes to root boo.py and stumbles upon finding boo/file/download.py.

How do I make this package work on collab?

1 Answer 1

0

I could fix the subpackage behavior by editing setup.py as suggested here:

  # ...
  packages=setuptools.find_packages()
  # ...

Somehow Colab is more restrictive on this parameter than local installation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.