Closed EricCousineau-TRI closed 4 years ago
Unfortunately, this package isn't intended for local use at all.
Makes sense.
FWIW, tried a few permutations on google.colab/__init__.py
, and could only get partway to allowing the extension to be enabled:
diff --git a/google/colab/__init__.py b/google/colab/__init__.py
index 7761954..0ee93bb 100644
--- a/google/colab/__init__.py
+++ b/google/colab/__init__.py
@@ -45,6 +45,7 @@ def _jupyter_nbextension_paths():
'dest': 'google.colab',
'section': 'notebook',
'src': 'resources',
+ 'require': 'google.colab/tabbar_main.min',
}]
Just passing by and wanted to drop a snippet:
For anyone hoping to run a Colab notebook in Jupyter and not wishing to edit out the from google.colab import
lines and not intending to use the colab bits then this snippet does the trick:
import sys
import types
from unittest.mock import Mock
fauxgle = types.ModuleType("google.colab")
fauxgle.__dict__.update( dict(files=Mock(), auth=Mock(), drive=Mock()) )
sys.modules["google.colab"] = fauxgle
from google.colab import files, auth, drive
With a mock you can do mock.foo().bar
, but no operations (e.g. mock / 10
), subscriptions (e.g. mock['foo']) and majorly iterate it as may happen with for fn in mock_files.upload()
.
Describe the current behavior
On my system (Python 3.6, Ubuntu 18.04), please see this gist: https://gist.github.com/EricCousineau-TRI/18a67c8712f7c96218fd48a63b900217#file-google-colab_nbextension_attempt-txt
Final lines:
Relates:
Describe the expected behavior:
It works?
Possible solutions:
require=
is defined in the nbextension manifestjupyter*
is defined insetup.py
s.t.require=
is not necessary?The web browser you are using (Chrome, Firefox, Safari, etc.):
N/A
Link (not screenshot!) to a minimal, public, self-contained notebook that reproduces this issue (click the Share button, then Get Shareable Link):
N/A. See Gist above for reproduction.