Skip to content

Instantly share code, notes, and snippets.

@ngrislain
Last active May 3, 2024 02:13
Show Gist options
  • Save ngrislain/c3ba6f687c64ce31adc6b0dff1b26d6a to your computer and use it in GitHub Desktop.
Save ngrislain/c3ba6f687c64ce31adc6b0dff1b26d6a to your computer and use it in GitHub Desktop.
py38 success.ipynb
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matanox
Copy link

matanox commented Mar 18, 2022

Could we equally pull it off without conda/anaconda/miniconda?

@ngrislain
Copy link
Author

Yes, I also tried with:

!apt-get install python3.5
!curl -O https://bootstrap.pypa.io/pip/3.5/get-pip.py
!python3.5 get-pip.py
!python3.5 -m pip install jupyter google-colab
!python3.5 -m ipykernel install --name "py35" --user

@matanox
Copy link

matanox commented Mar 19, 2022

Looks awesome. I see this can go up to 3.9.1 with the miniconda approach and up to 3.6 with the pypa repository. I guess for newer versions one has to build their python version of choice on their own. Never tried that myself to be honest.

@avm19
Copy link

avm19 commented Apr 4, 2022

Are you able to mount Google Drive in the new runtime? It looks like google-colab fails so badly it can't even print its own logs.
Whenever I try

from google.colab import drive
drive.mount('/gdrive')

I get

`grep: /root/.config/Google/DriveFS/Logs/drive_fs.txt: No such file or directory
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [3], in <cell line: 2>()
      1 from google.colab import drive
----> 2 drive.mount('/gdrive')

File /usr/local/lib/python3.8/site-packages/google/colab/drive.py:180, in mount(mountpoint, force_remount, timeout_ms)
    175   if 0 == _subprocess.call(
    176       'grep -q "{}" "{}"'.format(timeout_pattern, dfs_log), shell=True):
    177     extra_reason = (
    178         ': timeout during initial read of root folder; for more info: '
    179         'https://research.google.com/colaboratory/faq.html#drive-timeout')
--> 180   raise ValueError('mount failed' + extra_reason)
    181 elif case == 2:
    182   # Not already authorized, so do the authorization dance.
    183   auth_prompt = d.match.group(1) + '\n\nEnter your authorization code:\n'

ValueError: mount failed

P.S. A workaround is to mount the drive before running the top cell, but this is less than ideal.

@siahuat0727
Copy link

siahuat0727 commented Apr 22, 2022

Hi, thank you for sharing!
I tried the same code on a new notebook, but it failed. (I have refreshed the webpage)
I found a difference in my notebook, after running this cell to install Python, refresh the page and select Runtime -> Change runtime type, the notebook settings don't provide an option for runtime type.

Is there anything else we need to do to select the runtime type?
Any feedback you can give me on this would be greatly appreciated. Thank you.

image

image

@avm19
Copy link

avm19 commented Apr 22, 2022

@siahuat0727 The same code is not enough. It must be the same notebook, because the notebook file itself contains important metadata. If you came here from a post on StackOverflow, then refer back to the question: it is mentioned there what changes are made to the notebook file.

@siahuat0727
Copy link

siahuat0727 commented Apr 22, 2022

@avm19
Got it! Thanks a lot!

In case someone comes here later, here is the post.

@vak
Copy link

vak commented Nov 22, 2022

@ngrislain Cool, thanks!
Anyone knows how to turn on syntax highlighting?

@Arslan-Mehmood1
Copy link

I'm having the same issue of no python syntax highlighting working.

@smokingkrillz
Copy link

My google colab is stuck here: Connecting to py38 Google Compute Engine backend, after showing this message for a long time, it disconnects. Any tips?

@KemononLine
Copy link

My colab also is stuck at the same stage: disconnect-retry-disconnect...

@ubuangel
Copy link

ubuangel commented May 3, 2024

My colab also is stuck at the same stage: disconnect-retry-disconnect...

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