Jupyter notebook got crashed - visual-studio-code

Can't run Jupyter Notebook in VS Code
I am normally using Jupyter Notebook with VS Code and this crash:
Someone help me please!!
Failed to start the Kernel.
Jupyter server crashed. Unable to connect.
Error code from Jupyter: 1
usage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
[--paths] [--json] [--debug]
[subcommand]
Jupyter: Interactive Computing
positional arguments:
subcommand the subcommand to launch

Related

VSCode Meaning of : ptyhost warning Shell integration cannot be enabled for executable

In VSCode I connect from Windows to Ubuntu via the Remote SSH extension. I can open the VSCode Terminal window for 'bash' and I get to shell in the remote server.
But this message shows in the Log for Remote Pty Host:
[ptyhost] [warning] Shell integration cannot be enabled for executable "/bin/sh" and args ...
The args for /bin/sh have a script for wget and fallback to curl to call :
--header='Metadata-Flavor:Google' http://metadata.google.internal/computeMetadata/v1/instance/id
While I don't normally use tmux, I can open that and get to shell as well. But the log shows the same warning:
for executable "/usr/bin/tmux" and args undefined.
Bottom line: bash and tmux are working but I'm curious about the warnings, as I'm struggling with other issues related to VSCode and Remote SSH.
What are these ptyhost errors?
What are they telling us?
What should we do to fix the problem being reported?
Might this affect other operations from VSCode?

how to run mpi commands from Jupyter ipython kernel

I am trying to run the mpiexec command from the cell in Jupyter, firstly i am not sure what to write, should i write :
!mpiexec -np 4 mynotebook.ipynb
Secondly, when i run the above mpi command it runs fine but does not give me any output.
Here is what i did :
I installed ipyparallel and started ipcluster from terminal(Mac OS X).
I ran the command:
ipcluster start --profile=mpi -n 4
The servers started succcessfully but it does not show the profile "mpi" in iPython clusters in jupyter homepage.
Have i done all the steps right?
I love Jupyter and i would like to run mpi commands from there. TIA.

spark-notebook: command not found

I want to set up spark notebook on my laptop following the instructions listed in http://spark-notebook.io I gave the command bin/spark-notebook and I'm getting:
-bash: bin/spark-notebook: command not found
How to resolve this? I want to run spark-notebook for spark standalone and scala.
You can download
spark-notebook-0.7.0-pre2-scala-2.10.5-spark-1.6.3-hadoop-2.7.2-with-parquet.tqz
Set the path in bashrc
Example :
$sudo gedit ~/.bashrc
export SPARK_HOME=/yor/path/
export PATH=$PATH:$SPARK+HOME/bin
Then start your notebook following command...
$spark-notebook

BigInsights Example KnoxShell on Windows

Trying to use the KnoxShell example from Windows (using Cmder as shell emulator). When executing the following command, the shell locks, no prompt available and nothing happend. I can only close Shell.
Is that specific to Windows?
λ gradlew.bat -q --no-daemon shell
This is a gradle Application Shell.
You can import your application classes and act on them.
import org.apache.hadoop.gateway.shell.Hadoop;import
org.apache.hadoop.gateway.shell.hdfs.Hdfs;import org.apache.hadoop.gateway.shell.job.Job;import org.apache.hadoop.gateway.shell.workflow.Workflow;import org.apache.hadoop.gateway.shell.yarn.Yarn;import groovy.json.JsonSlurper;import java.util.concurrent.TimeUnit;
===> [import org.apache.hadoop.gateway.shell.Hadoop;import org.apache.hadoop.gateway.shell.hdfs.Hdfs;import org.apache.hadoop.gateway.shell.job.Job;import org.apache.hadoop.gateway.shell.workflow.Workflow;import org.apache.hadoop.gateway.shell.yarn.Yarn;import groovy.json.JsonSlurper;import java.util.concurrent.TimeUnit;]
session = Hadoop.login( https://bi-hadoop-prod-xxxx.bi.services.us-south.bluemix.net:8443/gateway/default, user, password);
slurper = new JsonSlurper();
Groovy Shell (1.8.3, JVM: 1.8.0_51)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:002> hadoop fs -ls /
I have tried the example on a Windows machine and it also hangs for me.
I have updated the README to state that this example does not support Windows and also added some logic to the build script to abort the example if it is being run on a Windows machine.

Using IPython console along side IPython notebook

While working on an IPython notebook, I'm increasingly finding myself wishing that the notebook would have a console attached to it, for interactive programming. I find myself adding lines to test snippets of code and then deleting them and that's the good usage. In the worse usage I'm changing the commands in the same line, evaluating the line over and over, changing entirely the purpose of the line until I get it right, and then I'm Ctrl-Zing all the way back to the original cell content.
If I could have an interactive interpreter at the bottom of the notebook, that would definitely increase my productivity. I know that a notebook has a kernel, but I wasn't able to attach a new ipython console to it. So my wonders are:
Is there a more efficient way to work with the notebook?
Assuming there isn't, how can I attach an ipython console to a notebook kernel?
Thanks!
Just do %qtconsole in one cell, and it will start a qtconsole attached to the same kernel.
Of course your kernel need to be local.
you can of course use the long method :
In [1]: %connect_info
{
"stdin_port": 50845,
"ip": "127.0.0.1",
"control_port": 50846,
"hb_port": 50847,
"signature_scheme": "hmac-sha256",
"key": "c68e7f64-f764-4417-ba3c-613a5bf99095",
"shell_port": 50843,
"transport": "tcp",
"iopub_port": 50844
}
Paste the above JSON into a file, and connect with:
$> ipython <app> --existing <file>
or, if you are local, you can connect with just:
$> ipython <app> --existing kernel-45781.json
or even just:
$> ipython <app> --existing
if this is the most recent IPython session you have started.
then
ipython qtconsole --existing kernel-45781.json
When you start the ipython notebook in the terminal, it will output something like this:
2015-03-26 13:05:52.772 [NotebookApp] Kernel started: 4604c4c3-523b-4373-bfdd-222eb1260156
Then start the ipython console like this:
ipython console --existing 4604c4c3
I find this easier than the other solution.