Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Jupyter behind a proxy

Is there a similar config to that of .condarc (anaconda 4.0.0) that allows Jupyter to be configured to work behind a corporate proxy on a local machine?

Error received:

HTTPError: HTTP Error 407: Proxy Authentication Required 
like image 411
tog Avatar asked Apr 14 '16 17:04

tog


People also ask

How do you pass a proxy in Python?

Another way to pass a proxy address to Python is to set the http_proxy and https_proxy environment variables. If you set environment variables, you don't need to define any proxies in your code. Just be aware that proxy settings passed through code now override settings set via environment variables.

Is Jupyter a client server architecture?

The Jupyter notebook web application is based on a server-client structure. The notebook server uses a two-process kernel architecture based on ZeroMQ, as well as Tornado for serving HTTP requests.

Can two people work on a Jupyter Notebook at the same time?

The new collaborative editing feature enables collaboration in real-time between multiple clients without user roles. When sharing the URL of a document to other users, they will have access to the same environment you are working on (they can e.g. write and execute the cells of a notebook).

Can you embed a Jupyter Notebook?

Embedding a notebook is very straightforward. Just grab the URL of the hosted notebook and put it as an iframe on your website. The below code is an example. Unfortunately, most third-party sites don't support such embeds.


1 Answers

Way easier: Just add the following to your notebook:

In [1]: import os         os.environ['http_proxy'] = "http://user:passwd@host:port"          os.environ['https_proxy'] = "https://user:passwd@host:port"  

after that, requests will work OK=200, e.g.

In [2]: import requests         requests.get("https://google.com") Out[2]: <Response [200]> 
like image 196
Boern Avatar answered Oct 01 '22 05:10

Boern