How to get internet access inside Jupyter notebook

Create a file

vi ~/.ipython/profile_default/startup/00-startup.py

Add the following inside it
(Change proxy details as per your own environment)

import sys,os,os.path
os.environ['HTTP_PROXY']="http://127.0.0.1:3128"
os.environ['http_proxy']="http://127.0.0.1:3128"
os.environ['HTTPS_PROXY']="http://127.0.0.1:3128"
os.environ['https_proxy']="http://127.0.0.1:3128"

# Test

Inside the notebook cell

import requests
requests.get("http://google.com")

No comments:

Post a Comment

Please share your views and comments below.

Thank You.