Re: [jupyter] [ANN] nbconvert 5.2.1 release

2017-05-27 Thread Brian Granger
Many congrats Mike!

On Fri, May 26, 2017 at 5:31 AM, Damián Avila  wrote:
> Congrats on the release Michael !!
>
> Cheers.
>
> 2017-05-26 1:03 GMT-03:00 Matthias Bussonnier
> :
>>
>> Thanks ! That's great congratulation on the release !
>>
>> --
>> M (the other one)
>>
>> On Thu, May 25, 2017 at 8:06 PM, Michael Pacer 
>> wrote:
>> > We are pleased to announce the release of nbconvert 5.2.1. Nbconvert is
>> > the
>> > tool you need to do things with your notebooks (after they are written).
>> >
>> > # Installation
>> > pip install -U nbconvert
>> >
>> > # Major features
>> >
>> > In this release (along with the usual bugfixes and documentation
>> > improvements, which are legion) we have a few new major features that
>> > have
>> > been requested for a long time:
>> >
>> > ## Global Content Filtering
>> >
>> > You now have the ability to remove input or output from code cells,
>> > markdown
>> > cells and the input and output prompts. The easiest way to access all of
>> > these is by using traitlets like TemplateExporter.exclude_input = True
>> > (or,
>> > for example HTMLExporter.exclude_markdown = True if you wanted to make
>> > it
>> > specific to HTML output). On the command line if you just want to not
>> > have
>> > input or output prompts just use --no-prompt.
>> >
>> > ## Execute notebooks from a function
>> >
>> > You can now use the executenb function to execute notebooks as though
>> > you
>> > ran the execute preprocessor on the notebooks. It returns the standard
>> > notebook and resources options.
>> >
>> > ## Remove cells based on regex pattern
>> >
>> > This removes cells based on their matching a regex pattern (by default,
>> > empty cells). This is the RegexRemovePreprocessor.
>> >
>> > ## Script exporter entrypoints for nonpython scripts
>> >
>> > Now there is an entrypoint for having an exporter specific to the type
>> > of
>> > script that is being exported. While designed for use with the IRkernel
>> > in
>> > particular (with a script exporter focused on exporting R scripts) other
>> > non-python kernels that wish to have a language specific exporter can
>> > now
>> > surface that directly.
>> >
>> > # Credits
>> >
>> > This release has been larger than previous releases. In it 33 authors
>> > contributed a total of 546 commits.
>> >
>> > Many thanks to the following individuals who contributed to this release
>> > (in
>> > alphabetical order):
>> >
>> > * Adam Chainz
>> > * Andreas Mueller
>> > * Bartosz T
>> > * Benjamin Ragan-Kelley
>> > * Carol Willing
>> > * Damián Avila
>> > * Elliot Marsden
>> > * Gao, Xiang
>> > * Jaeho Shin
>> > * Jan Schulz
>> > * Jeremy Kun
>> > * Jessica B. Hamrick
>> > * John B Nelson
>> > * juhasch
>> > * Livia Barazzetti
>> > * M Pacer
>> > * Matej Urbas
>> > * Matthias Bussonnier
>> > * Matthias Geier
>> > * Maximilian Albert
>> > * Michael Scott Cuthbert
>> > * Nicholas Bollweg
>> > * Paul Gowder
>> > * Paulo Villegas
>> > * Peter Parente
>> > * Philipp A
>> > * Scott Sanderson
>> > * Srinivas Reddy Thatiparthy
>> > * Sylvain Corlay
>> > * Thomas Kluyver
>> > * Till Hoffmann
>> > * Xiang Gao
>> > * YuviPanda
>> >
>> > Enjoy converting!
>> >
>> > Cheers,
>> > M
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Project Jupyter" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to jupyter+unsubscr...@googlegroups.com.
>> > To post to this group, send email to jupyter@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/jupyter/CAM3SX44t_fxfwb9JMwPcb9_3rQQHnikXAdAkbkV9aBuKYY3DCQ%40mail.gmail.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jupyter+unsubscr...@googlegroups.com.
>> To post to this group, send email to jupyter@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jupyter/CANJQusVRqrk6SbH147p%3DzAp7vcY-DuQY%2BAV-QqA8FnGHrUv_Wg%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Damián Avila
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/CAH%2BmRR2krEjGJKRWGnt_xt8%2B4kVr%2B5FySRA-6P%2BBjtB5ZsPwAw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State 

Re: [jupyter] c.InteractiveShellApp.matplotlib='auto' breaks %matplotlib notebook

2017-05-27 Thread Matthias Bussonnier
M is right, you can use --TerminalIPythonApp.matplotlib that should
apply only to the terminal frontend. --IPKernelApp.matplotlib would
apply only to the kernel.

Usually when I have a question like that, I use the following (replace
matplotlib by whatever option you need) to see all the options
available.

$ python -m ipykernel --help-all | grep matplotlib | grep '\-\-' and
$ ipython --help-all | grep matplotlib | grep '\-\-'

all the --UpperCase.lowercase are command line flags with equivalent
c.UpperCase.lowercase you can use in config files.
Obviously the one that appear in both of the above command affect
Terminal and notebook (technically ipykernel) at the same time, those
that appear only in one affect only said command.

-- 
M (the other one).

On Sat, May 27, 2017 at 6:26 PM, Mike Pacer  wrote:
> I'm guessing you can probably set it at a more specific level, but I'm not
> sure off the top of my head.
>
> But I can suggest an alternative solution. Use matplotlib 2+ and it's
> matplotlib.pyplot.ion() function. Doing that should not require you to
> specify any particular backend. It also makes your notebooks easier to
> export to a valid script.
>
> Cheers,
> M
>
>
> On Sat, May 27, 2017 at 18:13 Juan Nunez-Iglesias 
> wrote:
>>
>> Hi,
>>
>> I mostly use the IPython terminal when doing exploratory data analysis
>> with Python. I used to call `ipython --matplotlib` each time until I found
>> the `c.InteractiveShellApp.matplotlib = 'auto'` setting in
>> ipython_config.py. However, now when I run a Jupyter notebook, if I try to
>> use %matplotlib notebook, I get the error message:
>>
>> Warning: Cannot change to a different GUI toolkit: notebook. Using osx
>> instead.
>>
>> Is there a way to specify that I only want the 'auto' setting for the
>> IPython terminal, *not* for Jupyter kernels?
>>
>> Thanks!
>>
>> Juan.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to jupyter+unsubscr...@googlegroups.com.
>> To post to this group, send email to jupyter@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jupyter/7b117721-9f9b-47eb-b302-463f404db285%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/CAM3SX47HGyyXiySu9EU1bzFkGCAz_RHO1-5At%2B4V883PqhPgDQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CANJQusW4WyPYEFYVEj%3D9vDJ8XYve9VkTyRA9OKre37hM-F%3DbrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] Issue: I don't have permission to verify cookies, my auth token may have expired

2017-05-27 Thread MinRK
Can you report your jupyterhub and dockerspawner versions?

When JupyterHub launches a single-user server, it creates an auth token and
stores a record of that token (not the token itself) in its database. It
then passes the token to the single-user servers it starts. When JupyterHub
*stops* a single-user server, it deletes the record of that token unless
the Spawner has set a `.will_resume` flag. This error generally means that
the single-user server (in your case a docker container) still has an auth
token that has been deleted fro the Hub's database. This could be caused by
the Hub's database being cleared altogether, or the token being revoked at
some point without recreating the docker container.

Since you are using `.remove_containers = True`, containers shouldn't be
reusing tokens. If you *changed* this value, some containers may still
exist in a stopped state, and will need to be deleted first. If you ever
clear your `jupyterhub.sqlite` database, that will require that all your
user containers be deleted because they will have stale auth tokens.

-Min

On Fri, May 12, 2017 at 12:58 PM, Kuldeep Yadav 
wrote:

> Hello Everyone,
>
> I am facing a wierd issue and hope somebody can help me in debugging this.
> I have setup JupyterHub with DockerSpawner ( to spawn single user server)
> on a remote Ubuntu machine with PAM authentication. The things are broadly
> running fine, but some users experience '500 error: I don't have permission
> to verify cookies, my auth token may have expired', when they login using
> JupyterHub and it tries to spawn a single user server. On restarting the
> individual server, it works fine again. Can you please help? I am putting
> down my docker logs which are experiencing this issue.
>
> [I 2017-05-12 16:51:48.590 group11 notebookapp:1366] The Jupyter Notebook
> is running at: http://0.0.0.0:/user/group11/
> [I 2017-05-12 16:51:48.590 group11 notebookapp:1367] Use Control-C to stop
> this server and shut down all kernels (twice to skip confirmation).
> [I 2017-05-12 16:51:48.650 group11 log:47] 302 GET /user/group11
> (172.17.0.1) 0.75ms
> [E 2017-05-12 16:51:48.988 group11 auth:180]* I don't have permission to
> verify cookies, my auth token may have expired: [403] Forbidden*
> [W 2017-05-12 16:51:48.989 group11 web:1545] 500 GET
> /user/group11/api/sessions?_=1494607776779 (:::122.178.70.26):
> Permission failure checking authorization, I may need a new token
> [E 2017-05-12 16:51:49.016 group11 log:46] {
>   "X-Forwarded-Proto": "https",
>   "X-Forwarded-Host": "programming.videoken.com:8000",
>   "Host": "programming.videoken.com:8000",
>   "Accept": "application/json, text/javascript, */*; q=0.01",
>   "X-Forwarded-Port": "8000",
>   "X-Forwarded-For": ":::122.178.70.26",
>   "Referer": "https://programming.videoken.com:8000/user/group11/tree
> ?",
>   "Cookie": "jupyter-hub-token-group11=\"2|1:0|10:1494607908|25:
> jupyter-hub-token-group11|44:MDRhNDE1OWQ5NDU0NDEwYmFjNjQzMGFiNjM1MTI4Y2E=|
> 5ccc6b50db715168e0f114185d882ca445bdf2c985ab96a5649b7cf653d111b9\";
> _xsrf=2|7a6575c8|24031a0226b8948118c2242552861ef2|1494607773",
>   "Accept-Encoding": "gzip, deflate, br",
>   "X-Requested-With": "XMLHttpRequest",
>   "X-Xsrftoken": "2|7a6575c8|24031a0226b8948118c2242552861e
> f2|1494607773",
>   "Connection": "close",
>   "Accept-Language": "en-US,en;q=0.5",
>   "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0)
> Gecko/20100101 Firefox/54.0"
>
>
> My juputerhub_conf.py is as follows:
>
> from dockerspawner import DockerSpawner
> c.JupyterHub.spawner_class = DockerSpawner
>
> c.DockerSpawner.container_image = 'tensorflow-keras'
> c.DockerSpawner.remove_containers = True
> #c.DockerSpawner.host_homedir_format_string = '/home/ubuntu/jupyterusers/{
> username}'
> c.DockerSpawner.extra_create_kwargs.update({
> 'command': '/usr/local/bin/start-singleuser.sh'
> })
>
> notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or
> '/home/jovyan/work'
> c.DockerSpawner.notebook_dir = notebook_dir
>
> # Mount the real user's Docker volume on the host to the notebook user's
> # notebook directory in the container
> c.DockerSpawner.volumes = { '/datadrive/users/{username}': notebook_dir }
>
> import netifaces
> docker0 = netifaces.ifaddresses('docker0')
> docker0_ipv4 = docker0[netifaces.AF_INET][0]
> c.JupyterHub.hub_ip = docker0_ipv4['addr']
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/5944cf79-3ba6-4ea3-a4e5-42044ed594da%40googlegroups.com
> 

[jupyter] c.InteractiveShellApp.matplotlib='auto' breaks %matplotlib notebook

2017-05-27 Thread Juan Nunez-Iglesias
Hi,

I mostly use the IPython terminal when doing exploratory data analysis with 
Python. I used to call `ipython --matplotlib` each time until I found the 
`c.InteractiveShellApp.matplotlib = 'auto'` setting in ipython_config.py. 
However, now when I run a Jupyter notebook, if I try to use %matplotlib 
notebook, I get the error message:

Warning: Cannot change to a different GUI toolkit: notebook. Using osx 
instead.

Is there a way to specify that I only want the 'auto' setting for the 
IPython terminal, *not* for Jupyter kernels?

Thanks!

Juan.

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/7b117721-9f9b-47eb-b302-463f404db285%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] Re: Blocked cross origin API requests

2017-05-27 Thread MinRK
Since you are using an nginx proxy, you might need to set additional
`X-Forwarded-Host`, etc. headers to identify the proxied request. You could
also set the HOST header explicitly to the original HOST header, but
X-Forwarded-... headers should be handled correctly by tornado.

-Min

On Thu, May 18, 2017 at 10:48 AM, Tony Hirst  wrote:

> And... the jupyer server is behind an nginx proxy which is providing an
> additional authentication layer
>
> --tony
>
> On Thursday, 18 May 2017 18:42:58 UTC+1, Tony Hirst wrote:
>>
>> Example error:
>>
>> Blocking Cross Origin API request for /api/contents.  Origin:
>> http://ec2-MYINSTANCE.eu-west-1.compute.amazonaws.com:35180, Host:
>> notebooks
>>
>> On Thursday, 18 May 2017 18:41:28 UTC+1, Tony Hirst wrote:
>>>
>>> Hi
>>>
>>>
>>> I'm trying to run an AWS EC2 instance built from a custom AWS AMI
>>> containing a freshly built jupyter notebook server, which throws an error:
>>>
>>>
>>>
>>> Blocking Cross Origin API request for /api/contents
>>>
>>>
>>> when I try to create a new notebook.
>>>
>>>
>>> Is this a setting I need to tweak in the AWS config somewhere (I'm way
>>> out of my depth there!) or can it be worked around with a Jupyter config
>>> setting?
>>>
>>>
>>> -thanks
>>>
>>> --tony
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/15dcd5c0-4398-4442-b7b2-00fdae6292b1%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHNn8BWpBYRYBw8nMPmSRbs5sHo_-surG4qon17f7qsJzJ8K4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] jupyterhub: kernel starts but notebook cannot connect

2017-05-27 Thread MinRK
When an additional proxy is in front, such an error generally means that
the proxy isn’t proxying websocket connections correctly, which requires
some extra configuration .

In nginx config, this can look like:

map $http_upgrade $connection_upgrade {
  default upgrade;
  '' close;
}
...
location / {
  ...
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection $connection_upgrade;
}

-Min
​

On Mon, May 22, 2017 at 7:03 AM,  wrote:

> Hi Everyone,
>
> I am running jupyterhub within a Docker container behind an nginx proxy
> and it's been working really well for several months.
>
> I now have a user who can launch a python2 or python3 kernel but then
> cannot connect. I don't see any errors in either the jupyterhub or nginx
> logs.
>
> Any recommendations as to how to troubleshoot this further?
>
> --John
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/0e2ee5c9-b42c-425b-b5f2-74b15c9535f6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHNn8BUpF2%2BGfgfE8Z%3DkiLUXuWJ82Q86tjbrUwNj4GhtAjnOOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.