Reputation: 767
I received a strange error when i am using google colab and ask for some hints to config colab. Below is the code for reference:
import smtplib
smtp = smtplib.SMTP(timeout=10)
smtp.connect('alt1.gmail-smtp-in.l.google.com')
In personal labtop, i will receive this:
(220, b'mx.google.com ESMTP q2si18528340oiv.98 - gsmtp')
However, in colab, i received this:
/usr/lib/python3.7/socket.py in create_connection(address, timeout, source_address)
714 if source_address:
715 sock.bind(source_address)
--> 716 sock.connect(sa)
717 # Break explicitly a reference cycle
718 err = None
OSError: [Errno 99] Cannot assign requested address
May i know the root clause of it? and what should i do in colab config to fix it?
Upvotes: 0
Views: 1249
Reputation: 29
Go to : cat /etc/jupyter/jupyter_notebook_config.py
Add:
c.NotebookApp.allow_origin = 'https://colab.research.google.com'
Restart Notebook
Upvotes: 2