knitron
knitron copied to clipboard
Rather than use ipcluster, can knitron communicate with a running Jupyter kernel
Hello, I have started a Jupyter kernel using jupyter --kernel which loads the startup files ~/.ipython/profile_default/startup.
I would like to the knitron initialization routine to talk to this kernel rather than start it's own. Is this possible?
I'm also open to the idea of moving my startup files into the knitron profile, but is it possible to not use ipcluster to start the kernel? I dont seem to have it on my system
Thank you Saptarshi (using jupyter 4.2 and ipython 5.1.0)
I spoke too soon. I did install ipcluster, (very easy), but when i knitted things, i got this error
Version mismatch: /mnt/anaconda2/bin/ipython has version 2, but /mnt/anaconda2/bin/ipcluster is of version 2. This will likely result in unicode errors. Please set options(ipython = IPYTHON_PATH, ipcluster = IPCLUSTER_PATH).
but note , i have in my Rmd file `
options(ipython = "/mnt/anaconda2/bin/ipython", ipcluster = '/mnt/anaconda2/bin/ipcluster')
`
Also i got this warning message
Output created: a.html Warning message: In if (ipcluster_version != ipython_version) { : the condition has length > 1 and only the first element will be used
Which is likely causing the warning message to be printed. That said, the resulting html file had the correct output!
Is there something i can provide?
The knitron package works very well, and the version mismatch message is printed because the equality check in gets thrown off because the output in ipcluster_version is `> ipcluster_version
[1] "Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/mnt1/ -Xmx15000M -Xms1000M" [2] "Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/mnt1/ -Xmx15000M -Xms1000M"
[3] "Ivy Default Cache set to: /home/hadoop/.ivy2/cache" [4] "The jars for the packages stored in: /home/hadoop/.ivy2/jars" [5] ":: loading settings :: url = jar:file:/usr/lib/spark/jars/ivy-2.4.0.jar!/org/apache/ivy/core/settings/ivysettings.xml" [6] "com.databricks#spark-csv_2.10 added as a dependency" [7] ":: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0" [8] "\tconfs: [default]" [9] "\tfound com.databricks#spark-csv_2.10;1.2.0 in central" [10] "\tfound org.apache.commons#commons-csv;1.1 in central" [11] "\tfound com.univocity#univocity-parsers;1.5.1 in central" [12] ":: resolution report :: resolve 629ms :: artifacts dl 89ms" [13] "\t:: modules in use:" [14] "\tcom.databricks#spark-csv_2.10;1.2.0 from central in [default]" [15] "\tcom.univocity#univocity-parsers;1.5.1 from central in [default]" [16] "\torg.apache.commons#commons-csv;1.1 from central in [default]" [17] "\t---------------------------------------------------------------------" [18] "\t| | modules || artifacts |" [19] "\t| conf | number| search|dwnlded|evicted|| number|dwnlded|" [20] "\t---------------------------------------------------------------------" [21] "\t| default | 3 | 0 | 0 | 0 || 3 | 0 |" [22] "\t---------------------------------------------------------------------" [23] ":: retrieving :: org.apache.spark#spark-submit-parent" [24] "\tconfs: [default]" [25] "\t0 artifacts copied, 3 already retrieved (0kB/25ms)" [26] "Setting default log level to "WARN"." [27] "To adjust logging level use sc.setLogLevel(newLevel)." [28] "\033]0;IPython: home/hadoop\a mainpingspq = sqlContext.read.load("s3://{}/{}".format(bucket, prefix), "parquet") " [29] "-------------------------------------------------------------------------------" [30] "1. main_summary can be made available as the DataFrame caled mainpingspq" [31] "2. Save your python objects using saveObject(object), load in r via aswsobj" [32] "3. import mozillametricstools !" [33] "" [34] "View more at: https://github.com/saptarshiguha/mozillametricstools" [35] "---------------------------------------------------------------------------------" [36] "2"`