How to propagate errors out of IPython profile to a notebook? - ipython

When an error happens inside the start-up code of an IPython profile, ipython displays this error immediately.
For example, raise Exception('something bad') in ~/.ipython/profile_default/startup/01_error.py yields
----> 1 raise Exception('something bad')
Exception: something bad
right on the first line.
However, when using ipython notebook, the same error seems silently ignored.
It doesn't appear in the browser nor in the console window which launched it.
Is there a way to abort the notebook app when an error happens or at least display the error?

Related

Mysql Query Browser does not run

Suddenly, a blue screen appeared on the computer, and after that, the error appeared and the Mysql Query Browser did not run with the error. I've already reinstalled it, but it remains the same. What should I do?
Exception EmyxError in module MySQLQueryBrowser.exe at 0010F992 / Error while loaing store connections.Error Nunber 3

kedro context and catalog missing from ipython session

I launched ipython session and trying to load a dataset.
I am running
df = catalog.load("test_dataset")
Facing the below error
NameError: name 'catalog' is not defined
I also tried %reload_kedro but got the below error
UsageError: Line magic function `%reload_kedro` not found.
Even not able to load context either.
I am running the kedro environment from a Docker container.
I am not sure where I am going wrong.
new in 0.17.5 there is a fallback option, please run the following commands in your Jupyter/IPython session:
%load_ext kedro.extras.extensions.ipython
%reload_kedro <path_to_project_root>
This should help you get up and running.

After executing a period, Jupyter always display "kernel Restarting" accidently

I am executing a code in sever with Docker and jupyter.
I set my container with a feature: restart=always.
But, the jupyter always show a same error: Kernel Restarting, The kernel appears to have died. It will restart automatically.
The code is based on Keras with TensorFlow.
In this way, I need to restart manually it. And I need to execute the code from beginning if I have no save the parameters. And I cann't find the error in time, so it is wasting time.
So, is there any way to set it automatically connect successfully.

Using profiles with ipython/jupyter

Here is help output from ipython:
Examples
ipython notebook # start the notebook
ipython notebook --profile=sympy # use the sympy profile
ipython notebook --certfile=mycert.pem # use SSL/TLS certificate
Seems straightforward .. but then when invoking
$ipython notebook --profile=pyspark
The following warning occurs:
[W 20:54:38.623 NotebookApp] Unrecognized alias: '--profile=pyspark',
it will probably have no effect.
So then the online help is inconsistent with the warning message.
What is the correct way to activate the profile?
Update I tried reversing the order as follows:
$ipython --profile=pyspark notebook
But then a different warning occurs:
[TerminalIPythonApp] WARNING | File not found: u'notebook
The option is for the ipython binary, but you are trying to pass the option to the notebook application, as evident from the warning, which is from NotebookApp:
[W 20:54:38.623 NotebookApp] Unrecognized alias: '--profile=pyspark',
it will probably have no effect.
That's basically saying you are passing an option to notebook which it doesn't recognize, so it won't have any effect.
You need to pass the option to ipython:
ipython --profile=foo -- notebook
Online docs are inaccurate. The order needs to be reversed - with the -- option before notebook:
$ipython --profile=pyspark notebook
But .. the issues go beyond that even ..
It seems that jupyter (newer version of ipython) may not respect ipython profiles at all.
There are multiple references to same. Here is one from the Spark mailing list
Does anyone have a pointer to Jupyter configuration with pyspark? The
current material on python inotebook is out of date, and jupyter
ignores ipython profiles.

FISH error upon startup to access a file that does exist

On an Ubuntu 14.04, I have started to receive the following warning (or error) each time I start a new session in terminal :
Unable to make or open a FIFO for universal variables with path '/run/user/0/fishd.12c79b706e7a.notifier': Permission denied
When I try to look into this file, the file does not exist at all.
I had a similar problem setting my terminal to fish in IntelliJ IDEA on Manjaro.
Every time I opened up the terminal, it kept printing the following error message;
Unable to open universal variable file '/opt/intellij-idea-ultimate-edition/plugins/terminal/fish/fish_variables': Permission denied
The solution I used, while not ideal did stop the error message - it's trying to write to a root controlled location from user land. from the terminal type the following command:
chown -R USER:USER /opt/intellij-idea-ultimate-edition/plugins/terminal/fish
This is fish issue #2222.
The problem seems to be that you get the wrong value for $XDG_RUNTIME_DIR. In that issue the reporter said su -l caused it, which, unlike what the documentation said, did not clear $XDG_RUNTIME_DIR or set it again to the wrong value.
I get a much more benign issue on fish 2.2.0 (and current git):
fish: No TTY for interactive shell (tcgetpgrp failed)
setpgid: Inappropriate ioctl for device
which seems not to break anything, so I can only recommend upgrading.