{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[-0.04809765 -0.65510951 -0.06389409 -0.78956431 1.12613107]\n"
]
}
],
"source": [
"import numpy\n",
"print(numpy.random.normal(size=5))"
]
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [conda env:probscale]",
"language": "python",
"name": "conda-env-probscale-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}if 1:
import nbformat from nbconvert import preprocessors
nbfile = 'a_test.ipynb'
meta = {
'metadata': {
'path': '.',
}
}
with open(nbfile, 'r') as nbf:
nbook = nbformat.read(nbf, as_version=4)
runner = preprocessors.ExecutePreprocessor()
runner.preprocess(nbook, meta)
with open(nbfile, 'w') as nbf:
nbformat.write(nbook, nbf)--------------------------------------------------------------------------- KeyError Traceback (most recent call last) C:\Users\phobson\Miniconda3\envs\probscale\lib\site-packages\jupyter_client\kernelspec.py in get_kernel_spec(self, kernel_name) 172 try: --> 173 resource_dir = d[kernel_name.lower()] 174 except KeyError: KeyError: 'conda-env-probscale-py' [snip] C:\Users\phobson\Miniconda3\envs\probscale\lib\site-packages\jupyter_client\kernelspec.py in get_kernel_spec(self, kernel_name) 173 resource_dir = d[kernel_name.lower()] 174 except KeyError: --> 175 raise NoSuchKernel(kernel_name) 176 177 return self._get_kernel_spec_by_name(kernel_name, resource_dir) NoSuchKernel: No such kernel named conda-env-probscale-py
I tried adding the kernel spec from the notebook to metadata passed to runner.preprocess(nbook, meta), but that produced the same result.
Any thoughts or guidance would be much appreciated.
Cheers,
-Paul
> email to jupyter+unsubscribe@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/cbee4894-2f86-44f0-a130-2cf63081e47c%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CANJQusW2j%2B%3DSGrr%3DodjNEsXgTHwGHHNxQd0LCsksE2K8x4iqTw%40mail.gmail.com.
runner = preprocessors.ExecutePreprocessor(kernel_name='python3') # or 'python2', as appropriate
>> > email to jupyter+unsubscribe@googlegroups.com.
>> > To post to this group, send email to jup...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/jupyter/cbee4894-2f86-44f0-a130-2cf63081e47c%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+unsubscribe@googlegroups.com.
>> To post to this group, send email to jup...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jupyter/CANJQusW2j%2B%3DSGrr%3DodjNEsXgTHwGHHNxQd0LCsksE2K8x4iqTw%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+unsubscribe@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/CADT3MECr_J1kgHaFBOdv22wrR44kzUDzSZzE2_H%3DOkMchzmWAA%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CANJQusULtS_3UzoqSadiZyVv4EVA0e36uCYhYs9PsxrJiR5Lyg%40mail.gmail.com.
>> > email to jupyter+u...@googlegroups.com.
>> > To post to this group, send email to jup...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/jupyter/cbee4894-2f86-44f0-a130-2cf63081e47c%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+u...@googlegroups.com.
>> To post to this group, send email to jup...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jupyter/CANJQusW2j%2B%3DSGrr%3DodjNEsXgTHwGHHNxQd0LCsksE2K8x4iqTw%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+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/CADT3MECr_J1kgHaFBOdv22wrR44kzUDzSZzE2_H%3DOkMchzmWAA%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+u...@googlegroups.com.