Skip to content

Fixing import issues so that the package successfully installs on colab notebooks#1027

Merged
abidlabs merged 6 commits into
mainfrom
release-2.9b
Apr 19, 2022
Merged

Fixing import issues so that the package successfully installs on colab notebooks#1027
abidlabs merged 6 commits into
mainfrom
release-2.9b

Conversation

@abidlabs
Copy link
Copy Markdown
Member

@abidlabs abidlabs commented Apr 19, 2022

The pre-release gradio==2.9.0b0 was created from the new main branch, but whenever I try to test it on colab, I get this error: #1025

This PR attempts to fix that. Closes: #1025

@abidlabs abidlabs requested a review from omerXfaruq April 19, 2022 17:30
@abidlabs
Copy link
Copy Markdown
Member Author

Released 2.9.0b2 with these changes, let's see if it works in colab...

@abidlabs
Copy link
Copy Markdown
Member Author

abidlabs commented Apr 19, 2022

This seems to be working now! (Ignore the weird footer position)

image

@abidlabs abidlabs requested a review from aliabid94 April 19, 2022 17:40
@aliabid94
Copy link
Copy Markdown
Contributor

LGTM

@abidlabs
Copy link
Copy Markdown
Member Author

Thanks

@abidlabs abidlabs merged commit ef8b972 into main Apr 19, 2022
@abidlabs abidlabs deleted the release-2.9b branch April 19, 2022 18:27
@omerXfaruq
Copy link
Copy Markdown
Contributor

This actually is a very strange error and everything seems fine from project structure. Did you find any similar errors on internet? We would prefer having media_data under test_data if possible.

Comment thread test/test_components.py

import gradio as gr
from gradio.test_data import media_data
from gradio import media_data
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you need to apply these changes since you did this in test_data/init.py
import gradio.media_data as media_data

@omerXfaruq
Copy link
Copy Markdown
Contributor

omerXfaruq commented Apr 20, 2022

I am surprised this error happens with a package, because it does not happen with the folders inside colab.

image

@abidlabs
Copy link
Copy Markdown
Member Author

abidlabs commented Apr 20, 2022

Yeah @farukozderim. I tried various things including modifying the test_data/init.py file to import media_data in different ways, but nothing worked. And I could not find anything useful online either.

You can test this yourself by installing !pip install gradio==2.9.0b1 in a colab notebook and then running import gradio as gr

I agree with you that this is not an ideal solution, since media_data.py belongs under test_data if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModuleNotFoundError: No module named 'gradio.test_data' in colab notebook

3 participants